fix(@schematics/angular): fix migration of jasmine.clock().mockDate()#31919
fix(@schematics/angular): fix migration of jasmine.clock().mockDate()#31919clydin merged 1 commit intoangular:mainfrom
jasmine.clock().mockDate()#31919Conversation
The migration previously migrated `jasmine.clock().mockDate()` to `vi.setSystemTime()`, which does not compile because `vi.setSystemTime()` requires an argument. This commit fixes it by migrating `jasmine.clock().mockDate()` to `vi.setSystemTime(new Date())`.
atscott
left a comment
There was a problem hiding this comment.
Should this be new Date(0) so you get a consistent base time?
|
@atscott The documentation of Jasmine says that the default value is |
|
Ah, yes. I guess any test which uses the default can’t actually depend on the date in any way except for how much time has passed (right?). Don’t know at that point if it’s better to do |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The migration previously migrated
jasmine.clock().mockDate()tovi.setSystemTime(), which does not compile becausevi.setSystemTime()requires an argument. This commit fixes it by migratingjasmine.clock().mockDate()tovi.setSystemTime(new Date()).PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information