(
testBody: Function,
applyThis: any,
queueRunner: QueueRunner,
done?: Function,
)
| 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 |
no test coverage detected