Skip to content

Commit

Permalink
fix(zone.js): jest getRealSystemTime should return native time (#39127)
Browse files Browse the repository at this point in the history
`jest.getRealSystemTime()` should return native `Date.now()`, the
current implemenation return the wrong value which is the fixed
number.

PR Close #39127
  • Loading branch information
JiaLiPassion authored and atscott committed Oct 13, 2020
1 parent 8fd25d9 commit ffc3332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/zone.js/lib/jest/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Zone.__load_patch('jest', (context: any, Zone: ZoneType, api: _ZonePrivate) => {
return function(self: any, args: any[]) {
const fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');
if (fakeAsyncZoneSpec && isPatchingFakeTimer()) {
return fakeAsyncZoneSpec.getCurrentRealTime(args[0]);
return fakeAsyncZoneSpec.getRealSystemTime();
} else {
return delegate.apply(self, args);
}
Expand Down

0 comments on commit ffc3332

Please sign in to comment.