mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: fix some tests when path contains %
Tests should pass even if the path where the repo is cloned contains URL-significant chars. PR-URL: https://github.com/nodejs/node/pull/55082 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
parent
00d4f8073c
commit
7d0ce254e8
@ -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;
|
||||
|
@ -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(
|
||||
|
@ -822,7 +822,7 @@ describe('Loader hooks', { concurrency: !process.env.TEST_PARALLEL }, () => {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user