0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 12:10:08 +01:00
nodejs/test/es-module/test-esm-cjs-builtins.js
Jacob Smith 447635b440
test: refactor ESM tests to improve performance
PR-URL: https://github.com/nodejs/node/pull/43784
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-29 10:42:55 +02:00

21 lines
607 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');
const entry = fixtures.path('/es-modules/builtin-imports-case.mjs');
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');
});
});