/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v20.20.2
test/common/wasi.js
43 строки
925 B
Antoine du Hamel
test: add `spawnSyncAndAssert` util
03 май 2024, 09:30
03 май 2024, 09:30
6da446d
Код
Авторство
О чём код?
// Test version set to preview1 'use strict'; const { spawnSyncAndAssert } = require('./child_process'); const fixtures = require('./fixtures'); const childPath = fixtures.path('wasi-preview-1.js'); function testWasiPreview1(args, spawnArgs = {}, expectations = {}) { const newEnv = { ...process.env, NODE_DEBUG_NATIVE: 'wasi', NODE_PLATFORM: process.platform, ...spawnArgs.env, }; spawnArgs.env = newEnv; console.log('Testing with --turbo-fast-api-calls:', ...args); spawnSyncAndAssert( process.execPath, [ '--turbo-fast-api-calls', childPath, ...args, ], spawnArgs, expectations, ); console.log('Testing with --no-turbo-fast-api-calls:', ...args); spawnSyncAndAssert( process.execPath, [ '--no-turbo-fast-api-calls', childPath, ...args, ], spawnArgs, expectations, ); } module.exports = { testWasiPreview1, };