import { Callback } from "aws-lambda" ; import { mock , restore } from "aws-sdk-mock" ; import { VerificationCode } from "verification" ; import { mockVerificationCode } from "_/mocks/verification" ; param spy return function mockDynamoDBDocumentClientDelete ( spy ) { mock ( "DynamoDB.DocumentClient" , "delete" , ( data , cb ) => { cb ( undefined , spy ( data ) ) ; } ) ; return spy ; } param code return export function mockDynamoDBDocumentClientDeleteWithResult ( code = mockVerificationCode ( ) ) { return mockDynamoDBDocumentClientDelete ( jasmine . createSpy ( "delete" ) . and . returnValue ( { Attributes : code } ) ) ; } return export function mockDynamoDBDocumentClientDeleteWithoutResult ( ) { return mockDynamoDBDocumentClientDelete ( jasmine . createSpy ( "delete" ) . and . returnValue ( { } ) ) ; } param err return export function mockDynamoDBDocumentClientDeleteWithError ( err = new Error ( "delete" ) ) { return mockDynamoDBDocumentClientDelete ( jasmine . createSpy ( "delete" ) . and . callFake ( ( ) => { throw err ; } ) ) ; } /**
 * Restore `DynamoDB.DocumentClient.delete`
 */ export function restoreDynamoDBDocumentClientDelete ( ) { restore ( "DynamoDB.DocumentClient" , "delete" ) ; }