mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
17 lines
453 B
TypeScript
17 lines
453 B
TypeScript
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
|
|
|
export class MockNgZone extends NgZone {
|
|
_onEventDone: () => void;
|
|
|
|
constructor() { super({enableLongStackTrace: false}); }
|
|
|
|
run(fn: Function): any { return fn(); }
|
|
|
|
runOutsideAngular(fn: Function): any { return fn(); }
|
|
|
|
overrideOnEventDone(fn: () => void, opt_waitForAsync: boolean = false): void {
|
|
this._onEventDone = fn;
|
|
}
|
|
|
|
simulateZoneExit(): void { this._onEventDone(); }
|
|
}
|