(args, spawnArgs = {}, expectations = {})
| 6 | const childPath = fixtures.path('wasi-preview-1.js'); |
| 7 | |
| 8 | function testWasiPreview1(args, spawnArgs = {}, expectations = {}) { |
| 9 | const newEnv = { |
| 10 | ...process.env, |
| 11 | NODE_DEBUG_NATIVE: 'wasi', |
| 12 | NODE_PLATFORM: process.platform, |
| 13 | ...spawnArgs.env, |
| 14 | }; |
| 15 | spawnArgs.env = newEnv; |
| 16 | |
| 17 | console.log('Testing with --turbo-fast-api-calls:', ...args); |
| 18 | spawnSyncAndAssert( |
| 19 | process.execPath, [ |
| 20 | '--turbo-fast-api-calls', |
| 21 | childPath, |
| 22 | ...args, |
| 23 | ], |
| 24 | spawnArgs, |
| 25 | expectations, |
| 26 | ); |
| 27 | |
| 28 | console.log('Testing with --no-turbo-fast-api-calls:', ...args); |
| 29 | spawnSyncAndAssert( |
| 30 | process.execPath, |
| 31 | [ |
| 32 | '--no-turbo-fast-api-calls', |
| 33 | childPath, |
| 34 | ...args, |
| 35 | ], |
| 36 | spawnArgs, |
| 37 | expectations, |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | module.exports = { |
| 42 | testWasiPreview1, |
no test coverage detected
searching dependent graphs…