Command
generate
Is this a regression?
The previous version in which this bug was not present was
No response
Description
The following line in a spec file
jasmine.clock().install().mockDate(new Date(startingTime));
is transformed to
vi.useFakeTimers().mockDate(new Date(startingTime));
expected output:
vi.useFakeTimers().setSystemTime(new Date(startingTime));
Minimal Reproduction
example spec file:
describe('Foo', () => {
beforeEach(() => {
const startingTime = '1999-01-01T00:00:00.000Z';
jasmine.clock().install().mockDate(new Date(startingTime));
});
it('should be fine', () => {
expect(true).toBeTruthy();
});
});
Exception or Error
Your Environment
Angular CLI : 21.0.0
Angular : 21.0.0
Node.js : 25.1.0 (Unsupported)
Package Manager : npm 11.6.3
Operating System : darwin arm64
┌───────────────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────────────┼───────────────────┼───────────────────┤
│ @angular-devkit/core │ 21.0.0 │ 21.0.0 │
│ @angular/build │ 21.0.0 │ ^21.0.0 │
│ @angular/cdk │ 21.0.0 │ 21.0.0 │
│ @angular/cli │ 21.0.0 │ 21.0.0 │
│ @angular/common │ 21.0.0 │ 21.0.0 │
│ @angular/compiler │ 21.0.0 │ 21.0.0 │
│ @angular/compiler-cli │ 21.0.0 │ 21.0.0 │
│ @angular/core │ 21.0.0 │ 21.0.0 │
│ @angular/forms │ 21.0.0 │ 21.0.0 │
│ @angular/platform-browser │ 21.0.0 │ 21.0.0 │
│ @angular/platform-browser-dynamic │ 21.0.0 │ 21.0.0 │
│ @angular/router │ 21.0.0 │ 21.0.0 │
│ rxjs │ 7.8.2 │ 7.8.2 │
│ typescript │ 5.9.3 │ 5.9.3 │
└───────────────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
No response
Command
generate
Is this a regression?
The previous version in which this bug was not present was
No response
Description
The following line in a spec file
is transformed to
expected output:
Minimal Reproduction
ng g @schematics/angular:refactor-jasmine-vitestexample spec file:
Exception or Error
Your Environment
Anything else relevant?
No response