Skip to content

Commit

Permalink
test: improve WASI options validation
Browse files Browse the repository at this point in the history
Refs: https://github.com/nodejs/node/pull/30770/files#r353051438

PR-URL: #30800
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Trott authored and targos committed Dec 9, 2019
1 parent 1ed1a64 commit 25e3696
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/wasi/test-wasi-options-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ new WASI({});

// If args is not an Array and not undefined, it should throw.
assert.throws(() => { new WASI({ args: 'fhqwhgads' }); },
{ code: 'ERR_INVALID_ARG_TYPE' });
{ code: 'ERR_INVALID_ARG_TYPE', message: /\bargs\b/ });

// If env is not an Object and not undefined, it should throw.
assert.throws(() => { new WASI({ env: 'fhqwhgads' }); },
{ code: 'ERR_INVALID_ARG_TYPE' });
{ code: 'ERR_INVALID_ARG_TYPE', message: /\benv\b/ });

// If preopens is not an Object and not undefined, it should throw.
assert.throws(() => { new WASI({ preopens: 'fhqwhgads' }); },
{ code: 'ERR_INVALID_ARG_TYPE' });
{ code: 'ERR_INVALID_ARG_TYPE', message: /\bpreopens\b/ });

0 comments on commit 25e3696

Please sign in to comment.