()
| 6 | |
| 7 | let ns; |
| 8 | async function test() { |
| 9 | const newNs = await import('../fixtures/es-modules/tla/export-async.mjs'); |
| 10 | if (ns === undefined) { |
| 11 | ns = newNs; |
| 12 | } else { |
| 13 | // Check that re-evalaution is returning the same namespace. |
| 14 | assert.strictEqual(ns, newNs); |
| 15 | } |
| 16 | assert.strictEqual(ns.hello, 'world'); |
| 17 | |
| 18 | assert.throws(() => { |
| 19 | require('../fixtures/es-modules/tla/export-async.mjs'); |
| 20 | }, { |
| 21 | code: 'ERR_REQUIRE_ASYNC_MODULE', |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | // Run the test twice to check consistency after caching. |
| 26 | test().then(test).then(common.mustCall()); |
no test coverage detected
searching dependent graphs…