I am using an Amazon DynamoDB package from aws-sdk v3 for javascript.
Here is the docs which I have followed: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-examples.html
I have installed "@aws-sdk/client-dynamodb" package to perform CRUD operations from code.
I have imported commands from package in this way:
import { DynamoDBClient, PutItemCommand, DeleteItemCommand, UpdateItemCommand, GetItemCommand } from "@aws-sdk/client-dynamodb"; const dynamodbClient = new DynamoDBClient({ region: process.env.DYNAMODB_REGION, endpoint: process.env.DYNAMODB_ENDPOINT }); const result = await dynamodbClient.send(new PutItemCommand(params)); I have tried to mock Amazon DynamoDB following Jest docs but it was calling real Amazon DynamoDB in local.
How to mock these "@aws-sdk/client-dynamodb" package in Nodejs?
Please provide an example in Nodejs!