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