Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-esm-repl.js « es-module « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 653927b241694eb9c2548c2311080392acbbb94c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
require('../common');
const assert = require('assert');
const { spawn } = require('child_process');

const child = spawn(process.execPath, [
  '--interactive'
]);
child.stdin.end(`
import('fs').then(
  ns => ns.default === require('fs') ? 0 : 1,
  _ => 2
).then(process.exit)
`);

child.on('exit', (code) => {
  assert.strictEqual(code, 0);
});