Migrate Jasmine tests to Vitest
ProprietaryRewrites the Jasmine APIs in an Angular project's tests (*.spec.ts files and the helpers that name jasmine) to Vitest, as the Angular CLI's ng g @schematics/angular:refactor-jasmine-vitest schematic does: spies and their strategies, matchers, focused, skipped and pending tests, done callbacks, jasmine.clock(), fail() and the jasmine types. What has no Vitest equivalent is left with a // TODO: vitest-migration: comment for a person. Files that name jest are left to the Jest migration. This covers the test code only: moving the workspace's builder, tsconfig.spec.json and dependencies off Karma is org.openrewrite.angular.MigrateKarmaToVitest's part.
org. openrewrite. angular. MigrateJasmineToVitestOptional
Whether to import the Vitest globals a test uses, such as describe, it, expect and vi. Angular's unit-test builder runs Vitest with globals on, so they are not needed unless a project turned them off.
Whether the tests run in Vitest's browser mode, which has a toHaveClass matcher of its own.
Whether to rewrite fakeAsync, tick, flush and flushMicrotasks to Vitest fake timers. Left off, they keep running under zone.js's Vitest patch.
mod run . --recipe= org. openrewrite. angular. MigrateJasmineToVitestInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.