mirror of
https://github.com/nodejs/node.git
synced 2025-05-04 10:02:01 +00:00

PR-URL: https://github.com/nodejs/node/pull/47335 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
24 lines
689 B
JavaScript
24 lines
689 B
JavaScript
// Flags: --experimental-permission --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
{
|
|
assert.ok(typeof process.permission.has === 'function');
|
|
assert.throws(() => {
|
|
process.permission.has(null, '');
|
|
}, common.expectsError({
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
message: 'The "scope" argument must be of type string. Received null',
|
|
}));
|
|
assert.ok(!process.permission.has('invalid-key'));
|
|
assert.throws(() => {
|
|
process.permission.has('fs', {});
|
|
}, common.expectsError({
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
message: 'The "reference" argument must be of type string. Received an instance of Object',
|
|
}));
|
|
}
|