| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| 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 | |
|---|---|---|---|
@@ -11,8 +11,6 @@ const flags = '--experimental-modules ' + | |||
| 11 | 11 | '--es-module-specifier-resolution=node ' + | |
| 12 | 12 | '--experimental-specifier-resolution=node'; | |
| 13 | 13 | ||
| 14 | - exec(`${process.execPath} ${flags}`, { | ||
| 15 | - timeout: 300 | ||
| 16 | - }, mustCall((error) => { | ||
| 14 | + exec(`${process.execPath} ${flags}`, mustCall((error) => { | ||
| 17 | 15 | assert(error.message.includes(expectedError)); | |
| 18 | 16 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments