Skip to content

Commit 07e82db

Browse files
cjihrigBridgeAR
authored andcommitted
test: get lib/wasi.js coverage to 100%
This commit covers the last remaining uncovered code in lib/wasi.js. PR-URL: #31039 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
1 parent c779421 commit 07e82db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎test/wasi/test-wasi-options-validation.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ assert.throws(() =>{new WASI({env: 'fhqwhgads'})},
2020
// If preopens is not an Object and not undefined, it should throw.
2121
assert.throws(()=>{newWASI({preopens: 'fhqwhgads'});},
2222
{code: 'ERR_INVALID_ARG_TYPE',message: /\bpreopens\b/});
23+
24+
// If options is provided, but not an object, the constructor should throw.
25+
[null,'foo','',0,NaN,Symbol(),true,false,()=>{}].forEach((value)=>{
26+
assert.throws(()=>{newWASI(value);},
27+
{code: 'ERR_INVALID_ARG_TYPE'});
28+
});

0 commit comments

Comments
(0)