2019-09-04 11:19:14 -05:00
|
|
|
'use strict';
|
2025-10-25 23:05:02 +02:00
|
|
|
const common = require('../common');
|
2019-09-04 11:19:14 -05:00
|
|
|
const assert = require('assert');
|
|
|
|
|
const { spawn } = require('child_process');
|
|
|
|
|
|
|
|
|
|
const child = spawn(process.execPath, [
|
2021-03-26 08:51:08 -07:00
|
|
|
'--interactive',
|
2019-09-04 11:19:14 -05:00
|
|
|
]);
|
|
|
|
|
child.stdin.end(`
|
|
|
|
|
import('fs').then(
|
|
|
|
|
ns => ns.default === require('fs') ? 0 : 1,
|
|
|
|
|
_ => 2
|
|
|
|
|
).then(process.exit)
|
|
|
|
|
`);
|
|
|
|
|
|
2025-10-25 23:05:02 +02:00
|
|
|
child.on('exit', common.mustCall((code) => {
|
2019-09-04 11:19:14 -05:00
|
|
|
assert.strictEqual(code, 0);
|
2025-10-25 23:05:02 +02:00
|
|
|
}));
|