mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
PR-URL: https://github.com/nodejs/node/pull/41736 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
25 lines
813 B
JavaScript
25 lines
813 B
JavaScript
import '../common/index.mjs';
|
|
|
|
import { strictEqual, deepStrictEqual } from 'assert';
|
|
|
|
import { createRequire } from 'module';
|
|
|
|
import mod from '../fixtures/es-modules/json-cache/mod.cjs';
|
|
import another from '../fixtures/es-modules/json-cache/another.cjs';
|
|
import test from '../fixtures/es-modules/json-cache/test.json' assert
|
|
{ type: 'json' };
|
|
|
|
const require = createRequire(import.meta.url);
|
|
|
|
const modCjs = require('../fixtures/es-modules/json-cache/mod.cjs');
|
|
const anotherCjs = require('../fixtures/es-modules/json-cache/another.cjs');
|
|
const testCjs = require('../fixtures/es-modules/json-cache/test.json');
|
|
|
|
strictEqual(mod.one, 1);
|
|
strictEqual(another.one, 'zalgo');
|
|
strictEqual(test.one, 'it comes');
|
|
|
|
deepStrictEqual(mod, modCjs);
|
|
deepStrictEqual(another, anotherCjs);
|
|
deepStrictEqual(test, testCjs);
|