expect: Improve report when positive CalledWith assertion fails#8771
Merged
pedrottimark merged 4 commits intojestjs:masterfrom Aug 4, 2019
Merged
expect: Improve report when positive CalledWith assertion fails#8771pedrottimark merged 4 commits intojestjs:masterfrom
pedrottimark merged 4 commits intojestjs:masterfrom
Conversation
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
jeysal
approved these changes
Aug 1, 2019
Collaborator
jeysal
left a comment
There was a problem hiding this comment.
Beautiful <3
Only looked through the snaps since it's quite a lot of code changes, but I think the output is perfect this way, including regarding your questions. Trailing comma FTW :D
This was referenced Dec 31, 2019
This was referenced Jan 7, 2020
This was referenced Jan 21, 2020
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

















Summary
Fixes #7884
For positive
toHaveBeen*CalledWithassertions:ExpectedandReceivedlabelsNumber of callsat end of reportDisplay line diff for received call which corresponds to expected call number:
Residue: replace line diff with data-driven diff formatted on one line, when it becomes available
@bandersongit These improvements build on recent pull requests:
toHaveBeen*CalledWithmatcherstoHave*ReturnedWithmatchersRead the following descriptions with the qualifier if they exist:
toHaveBeenCalledWithcalled with 0 argumentstoHaveBeenLastCalledWithtoHaveBeenNthCalledWithQuestions
toHave*Returnedmatchers when received value is equal to expected?Faithful reviewers, this is last in series of basic improvements to all matchers! Thank you ❤️
Test plan
Updated 34 snapshots
toHaveBeenCalledWithtoBeCalledWithtoHaveBeenLastCalledWithlastCalledWithtoHaveBeenNthCalledWithnthCalledWithSee also pictures in following comments
Example pictures baseline at left and improved at right