Skip to content

Commit 5763911

Browse files
committed
fixup! skip tests that are hopeless
1 parent 510c38c commit 5763911

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

test/common/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,13 +1144,12 @@ const common = {
11441144
return fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n';
11451145
},
11461146

1147-
get isInsideCWDWithUnusualChars() {
1148-
const cwd = process.cwd();
1149-
return cwd.includes('%') ||
1150-
(!isWindows && cwd.includes('\\')) ||
1151-
cwd.includes('\n') ||
1152-
cwd.includes('\r') ||
1153-
cwd.includes('\t');
1147+
get isInsideDirWithUnusualChars() {
1148+
return __dirname.includes('%') ||
1149+
(!isWindows && __dirname.includes('\\')) ||
1150+
__dirname.includes('\n') ||
1151+
__dirname.includes('\r') ||
1152+
__dirname.includes('\t');
11541153
},
11551154
};
11561155

test/parallel/test-fs-cp.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mustCall, mustNotMutateObjectDeep, isInsideCWDWithUnusualChars } from '../common/index.mjs';
1+
import { mustCall, mustNotMutateObjectDeep, isInsideDirWithUnusualChars } from '../common/index.mjs';
22

33
import assert from 'assert';
44
import fs from 'fs';
@@ -370,7 +370,7 @@ function nextdir(dirname) {
370370
}
371371

372372
// It throws an error if attempt is made to copy socket.
373-
if (!isWindows && !isInsideCWDWithUnusualChars) {
373+
if (!isWindows && !isInsideDirWithUnusualChars) {
374374
const src = nextdir();
375375
mkdirSync(src);
376376
const dest = nextdir();

test/parallel/test-npm-install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const common = require('../common');
33
if (!common.hasCrypto)
44
common.skip('missing crypto');
5-
if (common.isInsideCWDWithUnusualChars)
5+
if (common.isInsideDirWithUnusualChars)
66
common.skip('npm does not support this install path');
77

88
const path = require('path');

test/parallel/test-snapshot-child-process-sync.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// restoring state from a snapshot
55

66
require('../common');
7-
const { isInsideCWDWithUnusualChars, spawnSyncAndAssert } = require('../common/child_process');
7+
const { isInsideDirWithUnusualChars, spawnSyncAndAssert } = require('../common/child_process');
88
const tmpdir = require('../common/tmpdir');
99
const fixtures = require('../common/fixtures');
1010
const assert = require('assert');
@@ -27,7 +27,7 @@ const expected = [
2727
file,
2828
], {
2929
cwd: tmpdir.path,
30-
env: { ...process.env, DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS: isInsideCWDWithUnusualChars ? 'TRUE' : '' },
30+
env: { ...process.env, DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS: isInsideDirWithUnusualChars ? 'TRUE' : '' },
3131
}, {
3232
trim: true,
3333
stdout(output) {
@@ -44,7 +44,7 @@ const expected = [
4444
file,
4545
], {
4646
cwd: tmpdir.path,
47-
env: { ...process.env, DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS: isInsideCWDWithUnusualChars ? 'TRUE' : '' },
47+
env: { ...process.env, DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS: isInsideDirWithUnusualChars ? 'TRUE' : '' },
4848
}, {
4949
trim: true,
5050
stdout(output) {

test/parallel/test-startup-empty-regexp-statics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const allRegExpStatics =
7171
assert.strictEqual(child.signal, null);
7272
}
7373

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

7777
let stdout = '';

0 commit comments

Comments
 (0)