mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
15456e4e57
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/52761 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
30 lines
614 B
JavaScript
30 lines
614 B
JavaScript
// Flags: --experimental-permission --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfWorker();
|
|
if (!common.hasCrypto)
|
|
common.skip('no crypto');
|
|
|
|
const assert = require('assert');
|
|
|
|
{
|
|
assert.throws(() => {
|
|
process.report.writeReport('./secret.txt');
|
|
}, common.expectsError({
|
|
code: 'ERR_ACCESS_DENIED',
|
|
permission: 'FileSystemWrite',
|
|
resource: './secret.txt',
|
|
}));
|
|
}
|
|
|
|
{
|
|
assert.throws(() => {
|
|
process.report.writeReport();
|
|
}, common.expectsError({
|
|
code: 'ERR_ACCESS_DENIED',
|
|
permission: 'FileSystemWrite',
|
|
resource: process.cwd(),
|
|
}));
|
|
}
|