Skip to content

Commit

Permalink
Fix wrong messages for nthCalledWith
Browse files Browse the repository at this point in the history
  • Loading branch information
chinesedfan authored May 29, 2018
1 parent 86c91d5 commit 4034c9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/expect/src/spy_matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ const createNthCalledWithMatcher = (matcherName: string) => (
`Expected ${identifier} ${nthToString(
nth,
)} call to have been called with:\n` +
formatMismatchedCalls(calls, expected, LAST_CALL_PRINT_LIMIT);
formatMismatchedCalls(calls[nth - 1] ? [calls[nth - 1]] : [], expected, LAST_CALL_PRINT_LIMIT);

return {message, pass};
};
Expand Down

0 comments on commit 4034c9c

Please sign in to comment.