/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v24.18.1
test/es-module/test-require-module-implicit.js
19 строк
521 B
Antoine du Hamel
tools: enforce trailing commas in `test/es-module`
23 фев 2026, 01:16
Не верифицирован
23 фев 2026, 01:16
8a0f619
Код
Авторство
О чём код?
// 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' }); }