const mockId = 'test' ; import { BaseStrategy } from './base-strategy' ; import { PeriodItem } from '@lib' ; class MockStrategy extends BaseStrategy { constructor ( ) { super ( mockId , mockId , mockId ) ; } public calculate ( period , periods ) { } public onPeriod ( ) { return null ; } } describe ( 'BaseStrategy' , ( ) => { test ( 'base class can be extended' , ( ) => { const mockStrategy = new MockStrategy ( ) ; expect ( mockStrategy instanceof BaseStrategy ) . toBeTruthy ( ) ; } ) ; test ( 'set preroll correctly' , ( ) => { const mockStrategy = new MockStrategy ( ) ; expect ( mockStrategy . isPreroll ) . toBeTruthy ( ) ; mockStrategy . prerollDone ( ) ; expect ( mockStrategy . isPreroll ) . toBeFalsy ( ) ; } ) ; } ) ;