2020-10-04 16:34:15 +02:00
|
|
|
'use strict';
|
|
|
|
|
2022-07-29 10:42:55 +02: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 16:34:15 +02:00
|
|
|
|
|
|
|
const entry = fixtures.path('/es-modules/builtin-imports-case.mjs');
|
|
|
|
|
2022-07-29 10:42:55 +02: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 16:34:15 +02:00
|
|
|
});
|