forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwasi.js
More file actions
43 lines (38 loc) · 925 Bytes
/
wasi.js
File metadata and controls
43 lines (38 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// 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,
};