/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.3.1
test/es-module/test-require-module-defined-esmodule.js
23 строки
578 B
Joyee Cheung
module: add __esModule to require()'d ESM
11 июл 2024, 21:59
11 июл 2024, 21:59
e77aac2
Код
Авторство
О чём код?
// Flags: --experimental-require-module 'use strict'; const common = require('../common'); // If an ESM already defines __esModule to be something else, // require(esm) should allow the user override. { const mod = require('../fixtures/es-modules/export-es-module.mjs'); common.expectRequiredModule( mod, { default: { hello: 'world' }, __esModule: 'test' }, false, ); } { const mod = require('../fixtures/es-modules/export-es-module-2.mjs'); common.expectRequiredModule( mod, { default: { hello: 'world' }, __esModule: false }, false, ); }