/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v22.22.2
test/module-hooks/test-module-hooks-preload.js
49 строк
2 KB
Joyee Cheung
module: implement module.registerHooks()
01 апр 2025, 02:38
Не верифицирован
01 апр 2025, 02:38
b2e44a8
Код
Авторство
О чём код?
'use strict'; require('../common'); const fixtures = require('../common/fixtures.js'); const { spawnSyncAndAssert } = require('../common/child_process.js'); spawnSyncAndAssert(process.execPath, [ '--require', fixtures.path('module-hooks', 'register-typescript-hooks.js'), fixtures.path('module-hooks', 'log-user.cts'), ], { trim: true, stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }', }); spawnSyncAndAssert(process.execPath, [ '--experimental-strip-types', '--no-experimental-transform-types', '--require', fixtures.path('module-hooks', 'register-typescript-hooks.js'), fixtures.path('module-hooks', 'log-user.cts'), ], { trim: true, stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }', }); spawnSyncAndAssert(process.execPath, [ '--import', fixtures.fileURL('module-hooks', 'register-typescript-hooks.js'), fixtures.path('module-hooks', 'log-user.mts'), ], { trim: true, stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }', }); spawnSyncAndAssert(process.execPath, [ '--experimental-strip-types', '--no-experimental-transform-types', '--import', fixtures.fileURL('module-hooks', 'register-typescript-hooks.js'), fixtures.path('module-hooks', 'log-user.mts'), ], { trim: true, stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }', });