Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! test: fix some assumptions in esm tests
  • Loading branch information
aduh95 committed Jul 29, 2023
commit ac64ca06f8e979638a64dc27cf67b58d311892a7
2 changes: 1 addition & 1 deletion test/parallel/test-internal-util-decorate-error-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ checkStack(err.stack);
// Verify that the stack is only decorated once for uncaught exceptions.
const args = [
'-e',
`require('${badSyntaxPath}')`,
`require(${JSON.stringify(badSyntaxPath)})`,
];
const result = spawnSync(process.argv[0], args, { encoding: 'utf8' });
checkStack(result.stderr);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-require-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ child.on('exit', common.mustCall(() => {

child.stdin.write('const isObject = (obj) => obj.constructor === Object;\n');
child.stdin.write('isObject({});\n');
child.stdin.write(`require('${fixture}').isObject({});\n`);
child.stdin.write(`require(${JSON.stringify(fixture)}).isObject({});\n`);
child.stdin.write('.exit');
child.stdin.end();
2 changes: 1 addition & 1 deletion test/parallel/test-stdio-pipe-stderr.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fs.writeFileSync(fakeModulePath, '', 'utf8');

stream.on('open', () => {
spawnSync(process.execPath, {
input: `require("${fakeModulePath.replace(/\\/g, '/')}")`,
input: `require(${JSON.stringify(fakeModulePath)})`,
stdio: ['pipe', 'pipe', stream]
});
const stderr = fs.readFileSync(stderrOutputPath, 'utf8').trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { isMainThread } = require('worker_threads');

if (isMainThread) {
const CODE = 'const { Worker } = require(\'worker_threads\'); ' +
`new Worker('${__filename.replace(/\\/g, '/')}', { name: 'foo' })`;
`new Worker(${JSON.stringify(__filename)}, { name: 'foo' })`;
const FILE_NAME = 'node_trace.1.log';
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-trace-events-worker-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { isMainThread } = require('worker_threads');

if (isMainThread) {
const CODE = 'const { Worker } = require(\'worker_threads\'); ' +
`new Worker('${__filename.replace(/\\/g, '/')}')`;
`new Worker(${JSON.stringify(__filename)})`;
const FILE_NAME = 'node_trace.1.log';
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
Expand Down