Skip to content

Commit

Permalink
test: get lib/wasi.js coverage to 100%
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cjihrig authored and BridgeAR committed Jan 3, 2020
1 parent c779421 commit 07e82db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/wasi/test-wasi-options-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ assert.throws(() => { new WASI({ env: 'fhqwhgads' }); },
// If preopens is not an Object and not undefined, it should throw.
assert.throws(() => { new WASI({ preopens: 'fhqwhgads' }); },
{ code: 'ERR_INVALID_ARG_TYPE', message: /\bpreopens\b/ });

// If options is provided, but not an object, the constructor should throw.
[null, 'foo', '', 0, NaN, Symbol(), true, false, () => {}].forEach((value) => {
assert.throws(() => { new WASI(value); },
{ code: 'ERR_INVALID_ARG_TYPE' });
});

0 comments on commit 07e82db

Please sign in to comment.