node/test/parallel/test-permission-wasi.js
Rafael Gonzaga 3ab0499d43
src,permission: --allow-wasi & prevent WASI exec
PR-URL: https://github.com/nodejs/node/pull/53124
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-06-01 13:13:12 +00:00

20 lines
378 B
JavaScript

// Flags: --experimental-permission --allow-fs-read=*
'use strict';
const common = require('../common');
const assert = require('node:assert');
const { WASI } = require('wasi');
{
assert.throws(() => {
new WASI({
version: 'preview1',
preopens: { '/': '/' },
});
}, common.expectsError({
code: 'ERR_ACCESS_DENIED',
permission: 'WASI',
}));
}