/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.2.0
test/es-module/test-esm-repl.js
18 строк
392 B
Antoine du Hamel
test: ensure assertions are reachable in `test/es-module`
07 ноя 2025, 11:24
Не верифицирован
07 ноя 2025, 11:24
5f77aeb
Код
Авторство
О чём код?
'use strict'; const common = require('../common'); const assert = require('assert'); const { spawn } = require('child_process'); const child = spawn(process.execPath, [ '--interactive', ]); child.stdin.end(` import('fs').then( ns => ns.default === require('fs') ? 0 : 1, _ => 2 ).then(process.exit) `); child.on('exit', common.mustCall((code) => { assert.strictEqual(code, 0); }));