Skip to content
Permalink
Browse files

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 <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
  • Loading branch information
cjihrig authored and BridgeAR committed Dec 20, 2019
1 parent c779421 commit 07e82db764b886de258cfddf92254bda309117dd
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/wasi/test-wasi-options-validation.js
@@ -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.
You can’t perform that action at this time.