(Zone: ZoneType)
| 1115 | } |
| 1116 | |
| 1117 | export function patchFakeAsyncTest(Zone: ZoneType): void { |
| 1118 | // Export the class so that new instances can be created with proper |
| 1119 | // constructor params. |
| 1120 | (Zone as any)['FakeAsyncTestZoneSpec'] = FakeAsyncTestZoneSpec; |
| 1121 | |
| 1122 | Zone.__load_patch( |
| 1123 | 'fakeasync', |
| 1124 | (global: any, Zone: ZoneType, api: _ZonePrivate) => { |
| 1125 | (Zone as any)[api.symbol('fakeAsyncTest')] = { |
| 1126 | resetFakeAsyncZone, |
| 1127 | flushMicrotasks, |
| 1128 | discardPeriodicTasks, |
| 1129 | tick, |
| 1130 | flush, |
| 1131 | fakeAsync, |
| 1132 | withProxyZone, |
| 1133 | }; |
| 1134 | }, |
| 1135 | true, |
| 1136 | ); |
| 1137 | |
| 1138 | patchedTimers = { |
| 1139 | setTimeout: global.setTimeout, |
| 1140 | setInterval: global.setInterval, |
| 1141 | clearTimeout: global.clearTimeout, |
| 1142 | clearInterval: global.clearInterval, |
| 1143 | nativeSetTimeout: global[Zone.__symbol__('setTimeout')], |
| 1144 | nativeClearTimeout: global[Zone.__symbol__('clearTimeout')], |
| 1145 | }; |
| 1146 | |
| 1147 | Scheduler.nextId = Scheduler.getNextId(); |
| 1148 | } |
| 1149 | |
| 1150 | async function safeAsync(fn: () => Promise<void>): Promise<void> { |
| 1151 | try { |
no test coverage detected
searching dependent graphs…