Skip to content

Commit

Permalink
chore: tweak mock in tests (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Sep 3, 2022
1 parent 4eb1449 commit 2ca3c9b
Show file tree
Hide file tree
Showing 2 changed files with 303 additions and 302 deletions.
7 changes: 4 additions & 3 deletions src/__tests__/runTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import { formatTsdResults } from '../formatter';
import runTest from '../run';

jest.mock('tsd-lite');
jest.mock('../formatter.js');

jest.mocked(formatTsdResults).mockReturnValue('<mocked failure message>');
jest.mock('../formatter', () => ({
...jest.requireActual('../formatter'),
formatTsdResults: jest.fn(() => '<mocked failure message>'),
}));

beforeEach(() => {
jest.spyOn(Date, 'now').mockReturnValueOnce(1000).mockReturnValueOnce(2800);
Expand Down
Loading

0 comments on commit 2ca3c9b

Please sign in to comment.