Skip to content

Commit 1d45ba3

Browse files
cjihrigtargos
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 4198d9a commit 1d45ba3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

+6
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(() => { new WASI({ 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(() => { new WASI(value); },
27+
{ code: 'ERR_INVALID_ARG_TYPE' });
28+
});

0 commit comments

Comments
 (0)