Skip to content

Commit

Permalink
Update snapshot for error thrown from toHaveBeenCalledAfter when seco…
Browse files Browse the repository at this point in the history
…nd mock is never called.
  • Loading branch information
theryansmee committed Mar 2, 2022
1 parent 2cc4a0d commit 8f4e19e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ Received second mock with invocationCallOrder:
<red>[25]</>"
`;
exports[`.toHaveBeenCalledAfter fails when given first mock has not been called 1`] = `
"<dim>expect(</><red>received</><dim>).toHaveBeenCalledAfter(</><green>expected</><dim>)</>
Expected first mock to have been called after, invocationCallOrder:
<green>[]</>
Received second mock with invocationCallOrder:
<red>[]</>"
`;
exports[`.toHaveBeenCalledAfter fails when given first mock is called before multiple calls to second mock 1`] = `
"<dim>expect(</><red>received</><dim>).toHaveBeenCalledAfter(</><green>expected</><dim>)</>
Expand Down
2 changes: 1 addition & 1 deletion src/matchers/toHaveBeenCalledAfter/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('.toHaveBeenCalledAfter', () => {
const mock1 = jest.fn();
const mock2 = jest.fn();

expect(() => expect(mock1).toHaveBeenCalledAfter(mock2)).toThrowError();
expect(() => expect(mock1).toHaveBeenCalledAfter(mock2)).toThrowErrorMatchingSnapshot();
});

test('fails when given first mock that has been called and a second mock that has not been called', () => {
Expand Down

0 comments on commit 8f4e19e

Please sign in to comment.