| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fb31ab5 commit 30756e3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,22 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + // Flags: --experimental-wasi-unstable-preview0 | ||
| 4 | + | ||
| 5 | + require('../common'); | ||
| 6 | + const assert = require('assert'); | ||
| 7 | + const { WASI } = require('wasi'); | ||
| 8 | + | ||
| 9 | + // If args is undefined, it should default to [] and should not throw. | ||
| 10 | + new WASI({}); | ||
| 11 | + | ||
| 12 | + // If args is not an Array and not undefined, it should throw. | ||
| 13 | + assert.throws(() => { new WASI({ args: 'fhqwhgads' }); }, | ||
| 14 | + { code: 'ERR_INVALID_ARG_TYPE' }); | ||
| 15 | + | ||
| 16 | + // If env is not an Object and not undefined, it should throw. | ||
| 17 | + assert.throws(() => { new WASI({ env: 'fhqwhgads' }); }, | ||
| 18 | + { code: 'ERR_INVALID_ARG_TYPE' }); | ||
| 19 | + | ||
| 20 | + // If preopens is not an Object and not undefined, it should throw. | ||
| 21 | + assert.throws(() => { new WASI({ preopens: 'fhqwhgads' }); }, | ||
| 22 | + { code: 'ERR_INVALID_ARG_TYPE' }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments