import { Callback } from "aws-lambda" ; import { mock , restore } from "aws-sdk-mock" ; param spy return function mockDynamoDBDocumentClientPut ( spy ) { mock ( "DynamoDB.DocumentClient" , "put" , ( data , cb ) => { cb ( undefined , spy ( data ) ) ; } ) ; return spy ; } return export function mockDynamoDBDocumentClientPutWithSuccess ( ) { return mockDynamoDBDocumentClientPut ( jasmine . createSpy ( "put" ) ) ; } param err return export function mockDynamoDBDocumentClientPutWithError ( err = new Error ( "put" ) ) { return mockDynamoDBDocumentClientPut ( jasmine . createSpy ( "put" ) . and . callFake ( ( ) => { throw err ; } ) ) ; } /**
 * Restore `DynamoDB.DocumentClient.put`
 */ export function restoreDynamoDBDocumentClientPut ( ) { restore ( "DynamoDB.DocumentClient" , "put" ) ; }