Commit c60762cbd54 for nodejs
commit c60762cbd54367ce71b733c4524ed63842fd2f5e
Author: Rafael Gonzaga <rafael.nunu@hotmail.com>
Date: Sat Oct 3 23:43:02 2026 +0200
test: remove duplicated cases in permission fs-read fixture
The fs.createReadStream(blockedFile) and fs.lstatSync(bufferBlockedFile)
assertions were each present twice in the same block with identical
arguments and expectations, so the second copy added no coverage.
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
diff --git a/test/fixtures/permission/fs-read.js b/test/fixtures/permission/fs-read.js
index 1ad12707ba5..511c9bf027b 100644
--- a/test/fixtures/permission/fs-read.js
+++ b/test/fixtures/permission/fs-read.js
@@ -76,17 +76,6 @@ const regularFile = __filename;
permission: 'FileSystemRead',
resource: path.toNamespacedPath(blockedFile),
})).then(common.mustCall());
-
- assert.rejects(() => {
- return new Promise((_resolve, reject) => {
- const stream = fs.createReadStream(blockedFile);
- stream.on('error', reject);
- });
- }, common.expectsError({
- code: 'ERR_ACCESS_DENIED',
- permission: 'FileSystemRead',
- resource: path.toNamespacedPath(blockedFile),
- })).then(common.mustCall());
}
// fs.stat
@@ -711,11 +700,6 @@ const regularFile = __filename;
}, common.expectsError({
code: 'ERR_ACCESS_DENIED',
}));
- assert.throws(() => {
- fs.lstatSync(bufferBlockedFile);
- }, common.expectsError({
- code: 'ERR_ACCESS_DENIED',
- }));
// doesNotThrow
fs.lstat(regularFile, (err) => {