node/test/parallel/test-permission-fs-internal-module-stat.js
Antoine du Hamel 634dc26605
test: ensure assertions are reached on all tests
PR-URL: https://github.com/nodejs/node/pull/60845
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-11-27 09:35:25 +00:00

23 lines
758 B
JavaScript

// Flags: --expose-internals --permission --allow-fs-read=test/common* --allow-fs-read=tools* --allow-fs-read=test/parallel* --allow-child-process --allow-natives-syntax
'use strict';
const common = require('../common');
const { isMainThread } = require('worker_threads');
const assert = require('assert');
if (!isMainThread) {
common.skip('This test only works on a main thread');
}
if (!common.hasCrypto) {
common.skip('no crypto');
}
const { internalBinding } = require('internal/test/binding');
const fixtures = require('../common/fixtures');
const blockedFile = fixtures.path('permission', 'deny', 'protected-file.md');
const internalFsBinding = internalBinding('fs');
assert.strictEqual(internalFsBinding.internalModuleStat(blockedFile), 0);