Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-12-20 20:16:36 +0300
committerRich Trott <rtrott@gmail.com>2019-12-23 04:05:52 +0300
commit5707ed21a253b2ed1e2f5944f622c20092b866d6 (patch)
tree25ca58053582f5e58c0c74f340dbdb8b7d60a990 /test
parent5a0cd9372457b27db1e567229504cf17d9f97eb1 (diff)
test: get lib/wasi.js coverage to 100%
This commit covers the last remaining uncovered code in lib/wasi.js. PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test')
-rw-r--r--test/wasi/test-wasi-options-validation.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/wasi/test-wasi-options-validation.js b/test/wasi/test-wasi-options-validation.js
index fe23e446b08..f07046b833d 100644
--- a/test/wasi/test-wasi-options-validation.js
+++ b/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' });
+});