Migrate Angular's fakeAsync tests to Vitest fake timers
ProprietaryRewrites tests using fakeAsync from @angular/core/testing to Vitest's fake timers: each fakeAsync(fn) becomes an async function, the outermost describe holding one gets vi.useFakeTimers() and vi.useRealTimers() hooks, tick(ms) becomes await vi.advanceTimersByTimeAsync(ms), flush() becomes await vi.runAllTimersAsync() and flushMicrotasks() becomes await vi.advanceTimersByTimeAsync(0). The tests then no longer need zone.js's fakeAsync patch. What flush returned, or its maxTurns, is left with a TODO: vitest-migration comment, as the Angular CLI's refactor-jasmine-vitest schematic does.
org. openrewrite. angular. migration. migrate-fake-async-to-vitest-timersmod run . --recipe= org. openrewrite. angular. migration. migrate-fake-async-to-vitest-timersInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.