Skip to content

Commit

Permalink
fix: dynamodb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vighnesh153 committed Nov 9, 2024
1 parent a835640 commit 8165425
Showing 1 changed file with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals } from "@std/assert";
import { beforeEach, describe, it } from "@std/testing/bdd";
import {
PutCommand,
BatchWriteCommand,
QueryCommand,
type ServiceOutputTypes,
} from "@aws-sdk/lib-dynamodb";
Expand Down Expand Up @@ -129,9 +129,16 @@ describe("createOne tests", () => {

assertEquals(
fakeDocumentClient.sendCalledWithArgs?.[0]?.input,
new PutCommand({
Item: item,
TableName: tableName,
new BatchWriteCommand({
RequestItems: {
[tableName]: [
{
PutRequest: {
Item: item,
},
},
],
},
}).input,
);
assertEquals(fakeDocumentClient.sendCalledWithArgs?.[1], undefined);
Expand All @@ -153,9 +160,16 @@ describe("createOne tests", () => {

assertEquals(
fakeDocumentClient.sendCalledWithArgs?.[0]?.input,
new PutCommand({
Item: item,
TableName: tableName,
new BatchWriteCommand({
RequestItems: {
[tableName]: [
{
PutRequest: {
Item: item,
},
},
],
},
}).input,
);
assertEquals(fakeDocumentClient.sendCalledWithArgs?.[1], undefined);
Expand Down

0 comments on commit 8165425

Please sign in to comment.