Skip to content

Commit

Permalink
test: unreadable directory support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-goudry committed Nov 12, 2023
1 parent f18ad8f commit a6c18ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Empty file.
19 changes: 19 additions & 0 deletions tests/ignore.js
@@ -1,3 +1,4 @@
import {chmod} from 'node:fs/promises';
import path from 'node:path';
import test from 'ava';
import slash from 'slash';
Expand Down Expand Up @@ -186,3 +187,21 @@ test('custom ignore files', async t => {
],
);
});

test.serial('bad permissions', async t => {
const cwd = path.join(PROJECT_ROOT, 'fixtures/bad-permissions');
const noReadDirectory = path.join(cwd, 'noread');

await chmod(noReadDirectory, 0o000);

await t.notThrowsAsync(
runIsIgnoredByIgnoreFiles(
t,
'**/*',
{cwd, ignore: ['noread']},
() => {},
),
);

t.teardown(() => chmod(noReadDirectory, 0o755));
});

0 comments on commit a6c18ab

Please sign in to comment.