import { HandlerCallbackResponse } from "handlers/_" ; template TResponse param promise return function mockHandlerCallback < TResponse extends { } > ( promise ) { return jasmine . createSpy ( "callback" ) . and . callFake ( promise ) ; } param body param headers return export function mockHandlerCallbackWithSuccess ( body ? , headers ? ) { return mockHandlerCallback ( ( ) => Promise . resolve ( { body , headers } ) ) ; } param err return export function mockHandlerCallbackWithError ( err = new Error ( "callback" ) ) { return mockHandlerCallback ( ( ) => Promise . reject ( err ) ) ; }