Skip to content

Commit

Permalink
fix: correct toHaveReturnedTimes condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed May 17, 2024
1 parent 3e39e13 commit b05c58a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/expect/src/jest-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
{
name: ['toHaveReturnedTimes', 'toReturnTimes'],
condition: (spy, times) =>
spy.mock.results.reduce((s, { type }) => type !== 'throw' ? s : ++s, 0) === times,
spy.mock.results.reduce((s, { type }) => type === 'throw' ? s : ++s, 0) === times,
action: 'called',
},
] satisfies ReturnMatcher<[number]>[]).forEach(({ name, condition, action }) => {
Expand Down

0 comments on commit b05c58a

Please sign in to comment.