mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
918e36e0b2
PR-URL: https://github.com/nodejs/node/pull/51183 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
18 lines
595 B
JavaScript
18 lines
595 B
JavaScript
// Flags: --experimental-permission --allow-addons --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfWorker();
|
|
|
|
const { createRequire } = require('node:module');
|
|
const assert = require('node:assert');
|
|
const fixtures = require('../common/fixtures');
|
|
const loadFixture = createRequire(fixtures.path('node_modules'));
|
|
// When a permission is set by cli, the process shouldn't be able
|
|
// to require native addons unless --allow-addons is sent
|
|
{
|
|
// doesNotThrow
|
|
const msg = loadFixture('pkgexports/no-addons');
|
|
assert.strictEqual(msg, 'using native addons');
|
|
}
|