2020-10-04 14:34:15 +00:00
|
|
|
'use strict';
|
|
|
|
|
2022-07-29 08:42:55 +00:00
|
|
|
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');
|
|
|
|
|
2020-10-04 14:34:15 +00:00
|
|
|
|
|
|
|
const entry = fixtures.path('/es-modules/builtin-imports-case.mjs');
|
|
|
|
|
2022-07-29 08:42:55 +00:00
|
|
|
describe('ESM: importing builtins & CJS', () => {
|
|
|
|
it('should work', async () => {
|
|
|
|
const { code, signal, stdout } = await spawnPromisified(execPath, [entry]);
|
|
|
|
|
|
|
|
assert.strictEqual(code, 0);
|
|
|
|
assert.strictEqual(signal, null);
|
|
|
|
assert.strictEqual(stdout, 'ok\n');
|
|
|
|
});
|
2020-10-04 14:34:15 +00:00
|
|
|
});
|