MCPcopy Index your code
hub / github.com/angular/angular / patchFakeAsyncTest

Function patchFakeAsyncTest

packages/zone.js/lib/zone-spec/fake-async-test.ts:1117–1148  ·  view source on GitHub ↗
(Zone: ZoneType)

Source from the content-addressed store, hash-verified

1115}
1116
1117export 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
1150async function safeAsync(fn: () => Promise<void>): Promise<void> {
1151 try {

Callers 4

rollupTestingFunction · 0.90
fake-async.tsFile · 0.90

Calls 4

__symbol__Method · 0.80
getNextIdMethod · 0.80
__load_patchMethod · 0.65
symbolMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…