import { decorators } from "./generated" ; import { ServiceSpy , SinonSpy } from "./types" ; param spy export const decorateSpy = ( spy ) : ServiceSpy => { return Object . assign ( spy , decorators ) ; } ; export const verifyOnlyOneCall = ( { spy , errPrefix , } ) : ServiceSpy => { const callCount = spy . callCount ; if ( callCount !== 1 ) { throw Error ( `${ errPrefix }: Expected one matching call, got ${ callCount } calls` ) ; } return spy ; } ; export default decorateSpy ;