/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.7.0
test/es-module/test-require-module-implicit.js
19 строк
521 B
Antoine du Hamel
tools: enforce trailing commas in `test/es-module`
03 дек 2025, 16:18
Не верифицирован
03 дек 2025, 16:18
9877403
Код
Авторство
О чём код?
// Flags: --experimental-require-module 'use strict'; // Tests that require()ing modules without explicit module type information // warns and errors. const common = require('../common'); const assert = require('assert'); { // .mjs should not be matched as default extensions. const id = '../fixtures/es-modules/should-not-be-resolved'; assert.throws(() => { require(id); }, { code: 'MODULE_NOT_FOUND', }); const mod = require(`${id}.mjs`); common.expectRequiredModule(mod, { hello: 'world' }); }