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