diff --git a/packages/core/testing/src/fake_async_fallback.ts b/packages/core/testing/src/fake_async_fallback.ts index 2ff6bf358a..6026708ece 100644 --- a/packages/core/testing/src/fake_async_fallback.ts +++ b/packages/core/testing/src/fake_async_fallback.ts @@ -27,6 +27,9 @@ let _fakeAsyncTestZoneSpec: any = null; * @publicApi */ export function resetFakeAsyncZoneFallback() { + if (_fakeAsyncTestZoneSpec) { + _fakeAsyncTestZoneSpec.unlockDatePatch(); + } _fakeAsyncTestZoneSpec = null; // in node.js testing we may not have ProxyZoneSpec in which case there is nothing to reset. ProxyZoneSpec && ProxyZoneSpec.assertPresent().resetDelegate(); @@ -73,6 +76,7 @@ export function fakeAsyncFallback(fn: Function): (...args: any[]) => any { let res: any; const lastProxyZoneSpec = proxyZoneSpec.getDelegate(); proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec); + _fakeAsyncTestZoneSpec.lockDatePatch(); try { res = fn.apply(this, args); flushMicrotasksFallback();