We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11473cc commit 8d0217bCopy full SHA for 8d0217b
test/wasi/test-wasi-options-validation.js
@@ -0,0 +1,22 @@
1
+'use strict';
2
+
3
+// Flags: --experimental-wasi-unstable-preview0
4
5
+require('../common');
6
+const assert = require('assert');
7
+const { WASI } = require('wasi');
8
9
+// If args is undefined, it should default to [] and should not throw.
10
+new WASI({});
11
12
+// If args is not an Array and not undefined, it should throw.
13
+assert.throws(() => { new WASI({ args: 'fhqwhgads' }); },
14
+ { code: 'ERR_INVALID_ARG_TYPE' });
15
16
+// If env is not an Object and not undefined, it should throw.
17
+assert.throws(() => { new WASI({ env: 'fhqwhgads' }); },
18
19
20
+// If preopens is not an Object and not undefined, it should throw.
21
+assert.throws(() => { new WASI({ preopens: 'fhqwhgads' }); },
22
0 commit comments