mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
This reverts commit 8e7f32f968
.
PR-URL: https://github.com/nodejs/node/pull/58024
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
28 lines
746 B
JavaScript
28 lines
746 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const cp = require('child_process');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
const args = ['--interactive'];
|
|
const opts = { cwd: fixtures.path('es-modules') };
|
|
const child = cp.spawn(process.execPath, args, opts);
|
|
|
|
let output = '';
|
|
child.stdout.setEncoding('utf8');
|
|
child.stdout.on('data', (data) => {
|
|
output += data;
|
|
});
|
|
|
|
child.on('exit', common.mustCall(() => {
|
|
const results = output.replace(/^> /mg, '').split('\n').slice(2);
|
|
assert.deepStrictEqual(
|
|
results,
|
|
['[Module: null prototype] { message: \'A message\' }', '']
|
|
);
|
|
}));
|
|
|
|
child.stdin.write('await import(\'./message.mjs\');\n');
|
|
child.stdin.write('.exit');
|
|
child.stdin.end();
|