blob: 4694d1c8e626e0da3bdcfbeef2b2146f836b195d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import '../common/index.mjs';
import assert from 'assert';
async function main() {
let mod;
try {
mod = await import('../fixtures/es-modules/pjson-main');
} catch (e) {
assert.strictEqual(e.code, 'ERR_UNSUPPORTED_DIR_IMPORT');
}
assert.strictEqual(mod, undefined);
try {
mod = await import('../fixtures/es-modules/pjson-main/main.mjs');
} catch (e) {
console.log(e);
assert.fail();
}
assert.strictEqual(mod.main, 'main');
}
main();
|