mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
22 lines
595 B
JavaScript
22 lines
595 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
const fixtures = require('../common/fixtures');
|
||
|
const { spawn } = require('child_process');
|
||
|
const assert = require('assert');
|
||
|
|
||
|
const entry = fixtures.path('/es-modules/cjs-exports.mjs');
|
||
|
|
||
|
const child = spawn(process.execPath, [entry]);
|
||
|
child.stderr.setEncoding('utf8');
|
||
|
let stdout = '';
|
||
|
child.stdout.setEncoding('utf8');
|
||
|
child.stdout.on('data', (data) => {
|
||
|
stdout += data;
|
||
|
});
|
||
|
child.on('close', common.mustCall((code, signal) => {
|
||
|
assert.strictEqual(code, 0);
|
||
|
assert.strictEqual(signal, null);
|
||
|
assert.strictEqual(stdout, 'ok\n');
|
||
|
}));
|