MCPcopy Create free account
hub / github.com/angular/angular / runInTestZone

Function runInTestZone

packages/zone.js/lib/jasmine/jasmine.ts:182–204  ·  view source on GitHub ↗
(
      testBody: Function,
      applyThis: any,
      queueRunner: QueueRunner,
      done?: Function,
    )

Source from the content-addressed store, hash-verified

180 }
181
182 function runInTestZone(
183 testBody: Function,
184 applyThis: any,
185 queueRunner: QueueRunner,
186 done?: Function,
187 ) {
188 const isClockInstalled = !!(jasmine as any)[symbol('clockInstalled')];
189 const testProxyZoneSpec = queueRunner.testProxyZoneSpec!;
190 const testProxyZone = queueRunner.testProxyZone!;
191 let lastDelegate;
192 if (isClockInstalled && enableAutoFakeAsyncWhenClockPatched) {
193 // auto run a fakeAsync
194 const fakeAsyncModule = (Zone as any)[Zone.__symbol__('fakeAsyncTest')];
195 if (fakeAsyncModule && typeof fakeAsyncModule.fakeAsync === 'function') {
196 testBody = fakeAsyncModule.fakeAsync(testBody);
197 }
198 }
199 if (done) {
200 return testProxyZone.run(testBody, applyThis, [done]);
201 } else {
202 return testProxyZone.run(testBody, applyThis);
203 }
204 }
205
206 /**
207 * Gets a function wrapping the body of a Jasmine `it/beforeEach/afterEach` block to

Callers 1

wrapTestInZoneFunction · 0.70

Calls 2

__symbol__Method · 0.80
runMethod · 0.65

Tested by

no test coverage detected