@@ -28,7 +28,7 @@ describe('Loader hooks throwing errors', { concurrency: true }, () => {
2828 fixtures . fileURL ( '/es-module-loaders/hooks-custom.mjs' ) ,
2929 '--input-type=module' ,
3030 '--eval' ,
31- `import ' ${ fixtures . fileURL ( '/es-modules/file.unknown' ) } ' ` ,
31+ `import ${ JSON . stringify ( fixtures . fileURL ( '/es-modules/file.unknown' ) ) } ` ,
3232 ] ) ;
3333
3434 assert . match ( stderr , / E R R _ U N K N O W N _ F I L E _ E X T E N S I O N / ) ;
@@ -142,7 +142,7 @@ describe('Loader hooks throwing errors', { concurrency: true }, () => {
142142 `import assert from 'node:assert';
143143 await Promise.allSettled([
144144 import('nonexistent/file.mjs'),
145- import(' ${ fixtures . fileURL ( '/es-modules/file.unknown' ) } ' ),
145+ import(${ JSON . stringify ( fixtures . fileURL ( '/es-modules/file.unknown' ) ) } ),
146146 import('esmHook/badReturnVal.mjs'),
147147 import('esmHook/format.false'),
148148 import('esmHook/format.true'),
@@ -170,7 +170,7 @@ describe('Loader hooks parsing modules', { concurrency: true }, () => {
170170 '--input-type=module' ,
171171 '--eval' ,
172172 `import assert from 'node:assert';
173- await import(' ${ fixtures . fileURL ( '/es-module-loaders/js-as-esm.js' ) } ' )
173+ await import(${ JSON . stringify ( fixtures . fileURL ( '/es-module-loaders/js-as-esm.js' ) ) } )
174174 .then((parsedModule) => {
175175 assert.strictEqual(typeof parsedModule, 'object');
176176 assert.strictEqual(parsedModule.namedExport, 'named-export');
@@ -191,7 +191,7 @@ describe('Loader hooks parsing modules', { concurrency: true }, () => {
191191 '--input-type=module' ,
192192 '--eval' ,
193193 `import assert from 'node:assert';
194- await import(' ${ fixtures . fileURL ( '/es-modules/file.ext' ) } ' )
194+ await import(${ JSON . stringify ( fixtures . fileURL ( '/es-modules/file.ext' ) ) } )
195195 .then((parsedModule) => {
196196 assert.strictEqual(typeof parsedModule, 'object');
197197 const { default: defaultExport } = parsedModule;
@@ -258,7 +258,7 @@ describe('Loader hooks parsing modules', { concurrency: true }, () => {
258258 '--input-type=module' ,
259259 '--eval' ,
260260 `import assert from 'node:assert';
261- await import(' ${ fixtures . fileURL ( '/es-modules/stateful.mjs' ) } ' )
261+ await import(${ JSON . stringify ( fixtures . fileURL ( '/es-modules/stateful.mjs' ) ) } )
262262 .then(({ default: count }) => {
263263 assert.strictEqual(count(), 1);
264264 });` ,
0 commit comments