Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Oct 23, 2025

This commit enhances the jasmine-to-vitest refactoring schematic by adding support for transforming Jasmine's type annotations. Previously, the schematic only handled function calls, leaving type usages like jasmine.SpyObj<T> untouched and causing compilation errors in the transformed code.

A new transformer now identifies and converts the following Jasmine types to their Vitest/TypeScript equivalents, preserving generics where appropriate:

  • jasmine.Spy -> Mock
  • jasmine.SpyObj<T> -> MockedObject<T>
  • jasmine.ObjectContaining<T> -> Partial<T>
  • jasmine.ObjectContaining -> object
  • jasmine.Any -> any
  • jasmine.DoneFn -> () => void

…ne-to-vitest schematic

This commit enhances the jasmine-to-vitest refactoring schematic by adding support for transforming Jasmine's type annotations. Previously, the schematic only handled function calls, leaving type usages like `jasmine.SpyObj<T>` untouched and causing compilation errors in the transformed code.

A new transformer now identifies and converts the following Jasmine types to their Vitest/TypeScript equivalents, preserving generics where appropriate:
  - `jasmine.Spy` -> `Mock`
  - `jasmine.SpyObj<T>` -> `MockedObject<T>`
  - `jasmine.ObjectContaining<T>` -> `Partial<T>`
  - `jasmine.ObjectContaining` -> `object`
  - `jasmine.Any` -> `any`
  - `jasmine.DoneFn` -> `() => void`
@clydin clydin added the target: major This PR is targeted for the next major release label Oct 23, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 23, 2025
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: rc This PR is targeted for the next release-candidate and removed action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Oct 23, 2025
@clydin clydin added target: major This PR is targeted for the next major release and removed target: rc This PR is targeted for the next release-candidate labels Oct 23, 2025
@clydin clydin merged commit 54c4eae into angular:main Oct 23, 2025
37 checks passed
@clydin clydin deleted the refactor/jasmine-type-transforms branch October 23, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants