node/test/parallel/test-permission-wasi.js

20 lines
378 B
JavaScript
Raw Permalink Normal View History

// 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',
}));
}