Skip to content

Commit

Permalink
Extends .toHaveBeenCalled message (#5951)
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Sobek authored and cpojer committed Apr 9, 2018
1 parent 56de010 commit 118f936
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

### Fixes

* `[jest-mock]` Extend .toHaveBeenCalled return message with outcome
([#5951](https://github.com/facebook/jest/pull/5951))
* `[jest-runner]` Assign `process.env.JEST_WORKER_ID="1"` when in runInBand mode
([#5860](https://github.com/facebook/jest/pull/5860))
* `[jest-cli]` Add descriptive error message when trying to use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Got:
exports[`toBeCalled .not passes when called 1`] = `
"<dim>expect(</><red>jest.fn()</><dim>).toBeCalled(</><dim>)</>

Expected mock function to have been called."
Expected mock function to have been called, but it was not called."
`;

exports[`toBeCalled fails with any argument passed 1`] = `
Expand Down Expand Up @@ -541,7 +541,7 @@ Got:
exports[`toHaveBeenCalled .not passes when called 1`] = `
"<dim>expect(</><red>jest.fn()</><dim>).toHaveBeenCalled(</><dim>)</>

Expected mock function to have been called."
Expected mock function to have been called, but it was not called."
`;

exports[`toHaveBeenCalled fails with any argument passed 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/src/spy_matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const createToBeCalledMatcher = matcherName => (received, expected) => {
: () =>
matcherHint(matcherName, receivedName, '') +
'\n\n' +
`Expected ${type} to have been called.`;
`Expected ${type} to have been called, but it was not called.`;

return {message, pass};
};
Expand Down

0 comments on commit 118f936

Please sign in to comment.