license import { EventEmitter , Injectable , NgZone , Provider } from '@angular/core' ; /**
 * Mock synchronous NgZone implementation that can be used
 * to flush out `onStable` subscriptions in tests.
 *
 * via: https://github.com/angular/angular/blob/master/packages/core/testing/src/ng_zone_mock.ts
 */ @ Injectable ( ) export class MockNgZone extends NgZone { static providers ( ) { return [ { provide : NgZone , useClass : MockNgZone } , ] ; } onStable : EventEmitter < any > = new EventEmitter ( false ) ; constructor ( ) { super ( { enableLongStackTrace : false } ) ; } run ( fn ) { return fn ( ) ; } runOutsideAngular ( fn ) { return fn ( ) ; } simulateZoneExit ( ) { this . onStable . emit ( null ) ; } }