MCPcopy Index your code
hub / github.com/nodejs/node / testWasiPreview1

Function testWasiPreview1

test/common/wasi.js:8–39  ·  view source on GitHub ↗
(args, spawnArgs = {}, expectations = {})

Source from the content-addressed store, hash-verified

6const childPath = fixtures.path('wasi-preview-1.js');
7
8function 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
41module.exports = {
42 testWasiPreview1,

Calls 2

spawnSyncAndAssertFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…