Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[kbn-optmizer] avoid mocking fs exports
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Feb 24, 2020
1 parent 04f2c9e commit 1a57263
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/kbn-optimizer/src/optimizer/cache_keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ jest.mock('execa');

jest.mock('fs', () => {
const realFs = jest.requireActual('fs');
jest.spyOn(realFs, 'readFile');
return realFs;
return {
...realFs,
readFile: jest.fn(realFs.readFile),
};
});

expect.addSnapshotSerializer(createAbsolutePathSerializer());
Expand Down

0 comments on commit 1a57263

Please sign in to comment.