/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.2.0
test/es-module/test-require-module-feature-detect.js
37 строк
849 B
Joyee Cheung
process: add process.features.require_module
07 окт 2024, 18:26
Не верифицирован
07 окт 2024, 18:26
b0f0252
Код
Авторство
О чём код?
'use strict'; // This tests that process.features.require_module can be used to feature-detect // require(esm) without triggering a warning. require('../common'); const { spawnSyncAndAssert } = require('../common/child_process'); spawnSyncAndAssert(process.execPath, [ '--experimental-require-module', '-p', 'process.features.require_module', ], { trim: true, stdout: 'true', stderr: '', // Should not emit warnings. }); // It is now enabled by default. spawnSyncAndAssert(process.execPath, [ '-p', 'process.features.require_module', ], { trim: true, stdout: 'true', stderr: '', // Should not emit warnings. }); spawnSyncAndAssert(process.execPath, [ '--no-experimental-require-module', '-p', 'process.features.require_module', ], { trim: true, stdout: 'false', stderr: '', // Should not emit warnings. });