Skip to content

Commit 37983d0

Browse files
committed
attempt at fixing more tests
1 parent e0d9d24 commit 37983d0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/common/assertSnapshot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function replaceWindowsPaths(str) {
2525
}
2626

2727
function replaceFullPaths(str) {
28-
return str.replaceAll(path.resolve(__dirname, '../..'), '');
28+
return str.replaceAll('\\\'', "'").replaceAll(path.resolve(__dirname, '../..').replaceAll('\'', '\\\''), '');
2929
}
3030

3131
function transform(...args) {

test/es-module/test-esm-invalid-pjson.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('ESM: Package.json', { concurrency: !process.env.TEST_PARALLEL }, () =>
1818
assert.ok(stderr.includes('code: \'ERR_INVALID_PACKAGE_CONFIG\''), stderr);
1919
assert.ok(
2020
stderr.includes(
21-
`Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${entry}.`
21+
`Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${path.toNamespacedPath(entry)}.`
2222
),
2323
stderr
2424
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const {
88
function spawn() {
99
const { spawnSync, execFileSync, execSync } = require('child_process');
1010
spawnSync(process.execPath, [ __filename, 'spawnSync' ], { stdio: 'inherit' });
11-
execSync(`"${process.execPath}" "${__filename}" "execSync"`, { stdio: 'inherit' });
11+
execSync(`"$NODE" "$FILE" "execSync"`, { stdio: 'inherit', env: { NODE: process.execPath, FILE: __filename } });
1212
execFileSync(process.execPath, [ __filename, 'execFileSync' ], { stdio: 'inherit' });
1313
}
1414

0 commit comments

Comments
 (0)