From 16aff286515c3177dc018e110f6740bb7088461a Mon Sep 17 00:00:00 2001 From: thoroc Date: Sun, 23 Jun 2024 20:22:44 +0100 Subject: [PATCH] test: initial test checking how do it --- dynamodb/tests/hasProperties.test.w | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 dynamodb/tests/hasProperties.test.w diff --git a/dynamodb/tests/hasProperties.test.w b/dynamodb/tests/hasProperties.test.w new file mode 100644 index 00000000..c6803865 --- /dev/null +++ b/dynamodb/tests/hasProperties.test.w @@ -0,0 +1,36 @@ +bring expect; +bring aws; +bring cloud; +bring ex; +bring "../dynamodb-types.w" as dynamodb_types; +bring "../dynamodb.sim.w" as dynamodb_sim; +bring "../dynamodb.w" as dynamodb; + +let tableWithBillingModeProvisioned = new dynamodb.Table({ + billingMode: dynamodb_types.BillingMode.PROVISIONED, + attributes: [ + { name: "id", type: "S" }, + ], + hashKey: "id", +}); + +let simClient = dynamodb_sim.Util.createClient({ + endpoint: "http://localhost:8000", + region: "us-west", + credentials: { + accessKeyId: "accessKeyId", + secretAccessKey: "secretAccessKey", + }, +}); + +test "Sim: table with billing mode `provisioned`" { + + let tableDescription = simClient.describeTable({ + TableName: tableWithBillingModeProvisioned.tableName, + }); + + expect.equal( + tableDescription.billingMode, + dynamodb_types.BillingMode.PROVISIONED + ); +}