Migrate Jasmine spies to Vitest mocks
ProprietaryRewrites Jasmine spies in Angular tests to Vitest's mocking API: spyOn becomes vi.spyOn(...).mockReturnValue(undefined), keeping Jasmine's stub-by-default behavior unless a strategy follows; .and.returnValue, .and.callFake, .and.resolveTo and the other strategies become the matching mock* calls; jasmine.createSpy and jasmine.createSpyObj become vi.fn() and an object of them; and spy.calls.count(), argsFor, first, mostRecent and all read vi.mocked(spy).mock. A strategy Vitest has no equivalent for, such as withArgs, is left with a TODO: vitest-migration comment, as the Angular CLI's refactor-jasmine-vitest schematic does.
org. openrewrite. angular. migration. migrate-jasmine-spies-to-vitestmod run . --recipe= org. openrewrite. angular. migration. migrate-jasmine-spies-to-vitestInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.