Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/workdir-setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,10 @@ describe('ensureDirectory EACCES diagnostic', () => {
{ code: 'EACCES' }
);
(fs.mkdirSync as jest.Mock).mockImplementationOnce(() => { throw eacces; });
// accessSync delegates to actualFs (all real dirs are writable), so no ancestor
// fails the check and the code falls back to the nearest existing ancestor.
// Mock accessSync to always pass so no ancestor fails the check and the code
// falls back to the nearest existing ancestor. Without this, system directories
// (e.g. /var/folders on macOS) may fail W_OK|X_OK and become the blocker.
(fs.accessSync as jest.Mock).mockImplementation(() => undefined);

expect(() => workdirSetupTestHelpers.ensureDirectory(targetDir)).toThrow(
new RegExp(`Blocked by: .*existing-parent`)
Expand Down
Loading