Skip to content

Commit

Permalink
skip tests that are hopeless
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 22, 2024
1 parent 95ed22b commit 65889cd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,15 @@ const common = {
get checkoutEOL() {
return fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n';
},

get isInsideCWDWithUnusualChars() {
const cwd = process.cwd();
return cwd.includes('%') ||
(!isWindows && cwd.includes('\\')) ||
cwd.includes('\n') ||
cwd.includes('\r') ||
cwd.includes('\t');
},
};

const validProperties = new Set(Object.keys(common));
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-fs-cp.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mustCall, mustNotMutateObjectDeep } from '../common/index.mjs';
import { mustCall, mustNotMutateObjectDeep, isInsideCWDWithUnusualChars } from '../common/index.mjs';

import assert from 'assert';
import fs from 'fs';
Expand Down Expand Up @@ -306,7 +306,7 @@ function nextdir() {
}

// It throws an error if attempt is made to copy socket.
if (!isWindows) {
if (!isWindows && !isInsideCWDWithUnusualChars) {
const src = nextdir();
mkdirSync(src);
const dest = nextdir();
Expand Down
2 changes: 2 additions & 0 deletions test/parallel/test-npm-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (common.isInsideCWDWithUnusualChars)
common.skip('npm does not support this install path');

const path = require('path');
const exec = require('child_process').exec;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-startup-empty-regexp-statics.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const allRegExpStatics =
assert.strictEqual(child.signal, null);
}

{
if (!common.isInsideCWDWithUnusualChars) {
const child = spawn(process.execPath, [], { stdio: ['pipe', 'pipe', 'inherit'], encoding: 'utf8' });

let stdout = '';
Expand Down

0 comments on commit 65889cd

Please sign in to comment.