diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js index 4890fa68c46110..24c4c81605a3c4 100644 --- a/test/common/inspector-helper.js +++ b/test/common/inspector-helper.js @@ -255,8 +255,8 @@ class InspectorSession { const callFrame = message.params.callFrames[0]; const location = callFrame.location; const scriptPath = this._scriptsIdsByUrl.get(location.scriptId); - assert.strictEqual(scriptPath.toString(), - expectedScriptPath.toString(), + assert.strictEqual(decodeURIComponent(scriptPath), + decodeURIComponent(expectedScriptPath), `${scriptPath} !== ${expectedScriptPath}`); assert.strictEqual(location.lineNumber, line); return true; diff --git a/test/es-module/test-esm-import-meta-resolve.mjs b/test/es-module/test-esm-import-meta-resolve.mjs index a9c26b7aecb926..f3b153062192af 100644 --- a/test/es-module/test-esm-import-meta-resolve.mjs +++ b/test/es-module/test-esm-import-meta-resolve.mjs @@ -45,7 +45,7 @@ assert.deepStrictEqual( { default: 'some://weird/protocol' }, ); assert.deepStrictEqual( - { ...await import(`data:text/javascript,export default import.meta.resolve("baz/", ${JSON.stringify(fixtures)})`) }, + { ...await import(`data:text/javascript,export default import.meta.resolve("baz/", ${encodeURIComponent(JSON.stringify(fixtures))})`) }, { default: fixtures + 'node_modules/baz/' }, ); assert.deepStrictEqual( diff --git a/test/es-module/test-esm-loader-hooks.mjs b/test/es-module/test-esm-loader-hooks.mjs index a82d23df03dfd6..717416d93e26c6 100644 --- a/test/es-module/test-esm-loader-hooks.mjs +++ b/test/es-module/test-esm-loader-hooks.mjs @@ -787,7 +787,7 @@ describe('Loader hooks', { concurrency: true }, () => { const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ '--no-warnings', '--experimental-loader', - `data:text/javascript,const fixtures=${JSON.stringify(fixtures.path('empty.js'))};export ${ + `data:text/javascript,const fixtures=${encodeURI(JSON.stringify(fixtures.path('empty.js')))};export ${ encodeURIComponent(function resolve(s, c, n) { if (s.endsWith('entry-point')) { return {