File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
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
+ { code : 'ERR_INVALID_ARG_TYPE' } ) ;
19
+
20
+ // If preopens is not an Object and not undefined, it should throw.
21
+ assert . throws ( ( ) => { new WASI ( { preopens : 'fhqwhgads' } ) ; } ,
22
+ { code : 'ERR_INVALID_ARG_TYPE' } ) ;
You can’t perform that action at this time.
0 commit comments