import { ChangeDetectorRef } from '@angular/core' ; import { TestBed } from '@angular/core/testing' ; import { IoService } from './io.service' ; describe ( 'Service: Io' , ( ) => { let service ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { providers : [ IoService , { provide : ChangeDetectorRef , useValue : { } } ] , } ) ; service = TestBed . inject ( IoService ) ; } ) ; it ( 'should throw if init was not called' , ( ) => { expect ( ( ) => service . maybeUpdate ( ) ) . toThrow ( ) ; } ) ; it ( 'should throw if `ComponentInjector` is set to null' , ( ) => { service . init ( null ) ; expect ( ( ) => service . maybeUpdate ( ) ) . toThrow ( ) ; } ) ; } ) ;