mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
447635b440
PR-URL: https://github.com/nodejs/node/pull/43784 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
21 lines
575 B
JavaScript
21 lines
575 B
JavaScript
'use strict';
|
|
|
|
const { spawnPromisified } = require('../common');
|
|
const fixtures = require('../common/fixtures.js');
|
|
const assert = require('node:assert');
|
|
const { execPath } = require('node:process');
|
|
const { describe, it } = require('node:test');
|
|
|
|
|
|
describe('ESM: importing CJS', () => {
|
|
it('should work', async () => {
|
|
const { code, signal, stdout } = await spawnPromisified(execPath, [
|
|
fixtures.path('/es-modules/cjs.js'),
|
|
]);
|
|
|
|
assert.strictEqual(code, 0);
|
|
assert.strictEqual(signal, null);
|
|
assert.strictEqual(stdout, 'executed\n');
|
|
});
|
|
});
|