mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
06603c44a5
Fixes: https://github.com/nodejs/node/issues/44612 PR-URL: https://github.com/nodejs/node/pull/45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
29 lines
709 B
JavaScript
29 lines
709 B
JavaScript
'use strict';
|
|
|
|
const { mustCall } = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
const assert = require('node:assert');
|
|
const { spawn } = require('node:child_process');
|
|
const { execPath } = require('node:process');
|
|
const { describe, it } = require('node:test');
|
|
|
|
|
|
describe('ESM: REPL runs', { concurrency: true }, () => {
|
|
it((done) => {
|
|
const child = spawn(execPath, [
|
|
'--interactive',
|
|
], {
|
|
cwd: fixtures.path('es-modules', 'pkgimports'),
|
|
});
|
|
|
|
child.stdin.end(
|
|
'try{require("#test");await import("#test")}catch{process.exit(-1)}'
|
|
);
|
|
|
|
child.on('exit', mustCall((code) => {
|
|
assert.strictEqual(code, 0);
|
|
done();
|
|
}));
|
|
});
|
|
});
|