From ffc3332dcdc19d9f5dafdde4dfad0ff65be95b3c Mon Sep 17 00:00:00 2001 From: JiaLiPassion Date: Tue, 6 Oct 2020 12:07:34 +0900 Subject: [PATCH] fix(zone.js): jest getRealSystemTime should return native time (#39127) `jest.getRealSystemTime()` should return native `Date.now()`, the current implemenation return the wrong value which is the fixed number. PR Close #39127 --- packages/zone.js/lib/jest/jest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zone.js/lib/jest/jest.ts b/packages/zone.js/lib/jest/jest.ts index efe9b6a433..651fe0ac96 100644 --- a/packages/zone.js/lib/jest/jest.ts +++ b/packages/zone.js/lib/jest/jest.ts @@ -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); }