(fn: Function)
| 23 | * @publicApi |
| 24 | */ |
| 25 | export function waitForAsync(fn: Function): (done: any) => any { |
| 26 | const _Zone: any = typeof Zone !== 'undefined' ? Zone : null; |
| 27 | if (!_Zone) { |
| 28 | return function () { |
| 29 | return Promise.reject( |
| 30 | 'Zone is needed for the waitForAsync() test helper but could not be found. ' + |
| 31 | 'Please make sure that your environment includes zone.js', |
| 32 | ); |
| 33 | }; |
| 34 | } |
| 35 | const asyncTest = _Zone && _Zone[_Zone.__symbol__('asyncTest')]; |
| 36 | if (typeof asyncTest === 'function') { |
| 37 | return asyncTest(fn); |
| 38 | } |
| 39 | return function () { |
| 40 | return Promise.reject( |
| 41 | 'zone-testing.js is needed for the async() test helper but could not be found. ' + |
| 42 | 'Please make sure that your environment includes zone.js/testing', |
| 43 | ); |
| 44 | }; |
| 45 | } |
no test coverage detected
searching dependent graphs…