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