feat(@schematics/angular): stabilize refactor-jasmine-vitest schematic#32874
Open
hawkgs wants to merge 1 commit intoangular:mainfrom
Open
feat(@schematics/angular): stabilize refactor-jasmine-vitest schematic#32874hawkgs wants to merge 1 commit intoangular:mainfrom
hawkgs wants to merge 1 commit intoangular:mainfrom
Conversation
48214dd to
fe6dcba
Compare
There was a problem hiding this comment.
Code Review
This pull request expands the Jasmine to Vitest migration schematics by adding support for several Jasmine APIs, including toBeNullish, createSpy, and various spy strategies. It also introduces TODO comments for unsupported Jasmine features and improves existing transformations for fail() and spy call inspections. Feedback was provided to improve the toBeNullish transformation by using loose equality to avoid double evaluation of expressions with side effects, and to use the TypeScript factory API for numeric literals in transformThisFor for better consistency.
packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher.ts
Show resolved
Hide resolved
packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher_spec.ts
Outdated
Show resolved
Hide resolved
packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher_spec.ts
Outdated
Show resolved
Hide resolved
packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy.ts
Outdated
Show resolved
Hide resolved
Stabilize `refactor-jasmine-vitest` schematic by covering the known remaining test patterns and cases.
fe6dcba to
c742ac9
Compare
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.
Stabilize
refactor-jasmine-vitestschematic by covering the known remaining test patterns and cases.The current state of the schematic covers the most common and used test patterns. This PR adds rather peripheral API to the list of supported transformations. Most of these do not have a Vitest equivalent.
jasmine.createSpy('withName')spy.calls.thisFor(index)spy.calls.saveArgumentsByValue()spy.and.identity().and.returnValue(Promise.resolve(x))/.and.returnValue(Promise.reject(x))fail(new Error())jasmine.clock().withMock()jasmine.clock().autoTick()jasmine.addAsyncMatchers()jasmine.addSpyStrategy()jasmine.addCustomObjectFormatter()toBeNullish()throwUnless()/throwUnlessAsync()getSpecProperty()jasmine.MAX_PRETTY_PRINT_DEPTH/MAX_PRETTY_PRINT_CHARS/MAX_PRETTY_PRINT_ARRAY_LENGTH