test(ivy): Add small_app spec for sprint #3 (#22018)

PR Close #22018
This commit is contained in:
Misko Hevery
2018-02-03 20:34:30 -08:00
committed by Victor Berchet
parent a63b764b54
commit ac2b04a5ab
21 changed files with 697 additions and 84 deletions

View File

@ -7,12 +7,13 @@
*/
const FakeAsyncTestZoneSpec = (Zone as any)['FakeAsyncTestZoneSpec'];
const _Zone: any = typeof Zone !== 'undefined' ? Zone : null;
const FakeAsyncTestZoneSpec = _Zone && _Zone['FakeAsyncTestZoneSpec'];
type ProxyZoneSpec = {
setDelegate(delegateSpec: ZoneSpec): void; getDelegate(): ZoneSpec; resetDelegate(): void;
};
const ProxyZoneSpec: {get(): ProxyZoneSpec; assertPresent: () => ProxyZoneSpec} =
(Zone as any)['ProxyZoneSpec'];
_Zone && _Zone['ProxyZoneSpec'];
let _fakeAsyncTestZoneSpec: any = null;
@ -24,7 +25,8 @@ let _fakeAsyncTestZoneSpec: any = null;
*/
export function resetFakeAsyncZone() {
_fakeAsyncTestZoneSpec = null;
ProxyZoneSpec.assertPresent().resetDelegate();
// in node.js testing we may not have ProxyZoneSpec in which case there is nothing to reset.
ProxyZoneSpec && ProxyZoneSpec.assertPresent().resetDelegate();
}
let _inFakeAsyncCall = false;