Skip to content

Commit

Permalink
fix: make test more plattform independent
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sc committed Jan 24, 2025
1 parent cbd7927 commit 750accf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/fileUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('fileUtils', () => {
expect(result).toBeNull();
});
it('should throw any other error', async () => {
jest.spyOn(fs, 'readFile').mockRejectedValue(new Error('some random fs error'));
await expect(readFileIfExists('some-file.txt')).rejects.toEqual(new Error('some random fs error'));
await expect(readFileIfExists('.')).rejects.toMatchObject({code: 'EISDIR'});
});
});

0 comments on commit 750accf

Please sign in to comment.