Repository navigation
Conversation
…dOnceWith in refactor-jasmine-vitest `expect(spy).not.toHaveBeenCalledOnceWith(...)` was split into `not.toHaveBeenCalledTimes(1)` and `not.toHaveBeenCalledWith(...)`, which asserts that neither condition holds instead of not both. For example, a spy called twice with the same arguments passed before the migration and failed after it. Transform the negated form to `not.toHaveBeenCalledExactlyOnceWith(...)`, which has the same meaning.
There was a problem hiding this comment.
Code Review
This pull request updates the transformCalledOnceWith transformer in the Jasmine-to-Vitest refactoring schematic to correctly handle negated assertions. Specifically, it transforms .not.toHaveBeenCalledOnceWith() into .not.toHaveBeenCalledExactlyOnceWith() instead of splitting it into two separate negated assertions, which would alter the logical meaning. A corresponding unit test has also been added to verify this behavior. I have no feedback to provide.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
expect(spy).not.toHaveBeenCalledOnceWith(...)was split intonot.toHaveBeenCalledTimes(1)andnot.toHaveBeenCalledWith(...), which asserts that neither condition holds instead of not both. For example, a spy called twice with the same arguments passed before the migration and failed after it.Transform the negated form to
not.toHaveBeenCalledExactlyOnceWith(...), which has the same meaning.