import { Callback } from "aws-lambda" ; import { mock , restore } from "aws-sdk-mock" ; param spy return function mockCognitoAdminConfirmSignUp ( spy ) { mock ( "CognitoIdentityServiceProvider" , "adminConfirmSignUp" , ( data , cb ) => { cb ( undefined , spy ( data ) ) ; } ) ; return spy ; } return export function mockCognitoAdminConfirmSignUpWithSuccess ( ) { return mockCognitoAdminConfirmSignUp ( jasmine . createSpy ( "adminConfirmSignUp" ) ) ; } param err return export function mockCognitoAdminConfirmSignUpWithError ( err = new Error ( "adminConfirmSignUp" ) ) { return mockCognitoAdminConfirmSignUp ( jasmine . createSpy ( "adminConfirmSignUp" ) . and . callFake ( ( ) => { throw err ; } ) ) ; } /**
 * Restore `CognitoIdentityServiceProvider.adminConfirmSignUp`
 */ export function restoreCognitoAdminConfirmSignUp ( ) { restore ( "CognitoIdentityServiceProvider" , "adminConfirmSignUp" ) ; }