| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1112,7 +1112,7 @@ Module.prototype._compile = function(content, filename) { | |||
| 1112 | 1112 | } catch { | |
| 1113 | 1113 | // We only expect this codepath to be reached in the case of a | |
| 1114 | 1114 | // preloaded module (it will fail earlier with the main entry) | |
| 1115 | - assert(Array.isArray(getOptionValue('--require'))); | ||
| 1115 | + assert(ArrayIsArray(getOptionValue('--require'))); | ||
| 1116 | 1116 | } | |
| 1117 | 1117 | } else { | |
| 1118 | 1118 | resolvedArgv = 'repl'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ child.on('close', common.mustCall((code, signal) => { | |||
| 26 | 26 | assert.strictEqual(code, 1); | |
| 27 | 27 | assert.strictEqual(signal, null); | |
| 28 | 28 | ||
| 29 | - assert.ok(stderr.indexOf( | ||
| 29 | + assert.ok(stderr.replace(/\r/g, '').includes( | ||
| 30 | 30 | `Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: ${required}` + | |
| 31 | 31 | '\nrequire() of ES modules is not supported.\nrequire() of ' + | |
| 32 | 32 | `${required} from ${requiring} ` + | |
@@ -35,10 +35,7 @@ child.on('close', common.mustCall((code, signal) => { | |||
| 35 | 35 | 'files in that package scope as ES modules.\nInstead rename ' + | |
| 36 | 36 | `${basename} to end in .cjs, change the requiring code to use ` + | |
| 37 | 37 | 'import(), or remove "type": "module" from ' + | |
| 38 | - `${pjson}.\n`) !== -1); | ||
| 39 | - assert.ok(stderr.indexOf( | ||
| 40 | - 'Error [ERR_REQUIRE_ESM]: Must use import to load ES Module') !== -1); | ||
| 41 | - | ||
| 42 | - assert.strictEqual( | ||
| 43 | - stderr.match(/Must use import to load ES Module/g).length, 1); | ||
| 38 | + `${pjson}.\n`)); | ||
| 39 | + assert.ok(stderr.includes( | ||
| 40 | + 'Error [ERR_REQUIRE_ESM]: Must use import to load ES Module')); | ||
| 44 | 41 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,8 +9,6 @@ const expectedError = | |||
| 9 | 9 | const flags = '--es-module-specifier-resolution=node ' + | |
| 10 | 10 | '--experimental-specifier-resolution=node'; | |
| 11 | 11 | ||
| 12 | - exec(`${process.execPath} ${flags}`, { | ||
| 13 | - timeout: 300 | ||
| 14 | - }, mustCall((error) => { | ||
| 12 | + exec(`${process.execPath} ${flags}`, mustCall((error) => { | ||
| 15 | 13 | assert(error.message.includes(expectedError)); | |
| 16 | 14 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments