Skip to content

Commit caed63e

Browse files
test: Mock fs.existsSync and fs.statSync
1 parent d6419b9 commit caed63e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/createArchive.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ describe('createArchive', () => {
2323

2424
beforeEach(() => {
2525
(fs.createWriteStream as jest.Mock).mockReturnValue(mockOutput);
26+
(fs.existsSync as jest.Mock).mockReturnValue(true);
27+
(fs.statSync as jest.Mock).mockReturnValue({
28+
isDirectory: () => true,
29+
});
2630
(archiver as unknown as jest.Mock).mockReturnValue(mockArchive);
2731
jest.clearAllMocks();
2832
});

0 commit comments

Comments
 (0)