import Spy = jasmine . Spy ; import { VacuumProcessor } from "../../scripts/processors/vacuum-processor" ; describe ( "VacuumProcessor" , ( ) => { it ( "should be a pro" , ( done ) => { const vacuumProcessor = new VacuumProcessor ( null ) ; const getCurrentAthleteSpy = spyOn ( vacuumProcessor , "getCurrentAthlete" ) ; expect ( getCurrentAthleteSpy ) . not . toHaveBeenCalled ( ) ; expect ( vacuumProcessor . getProStatus ( ) ) . toBeFalsy ( ) ; getCurrentAthleteSpy . and . returnValue ( { attributes : { premium : true } } ) ; expect ( vacuumProcessor . getProStatus ( ) ) . toEqual ( false ) ; getCurrentAthleteSpy . and . returnValue ( { attributes : { pro : true } } ) ; expect ( vacuumProcessor . getProStatus ( ) ) . toEqual ( true ) ; expect ( getCurrentAthleteSpy ) . toHaveBeenCalledTimes ( 3 ) ; done ( ) ; } ) ; } ) ;