DynamoDB
A collection of matchers that you can use to assert on DynamoDB items.
Use the dynamodbItem()
helper function to specify which dynamoDB Item you are testing. It takes the following input parameters:
tableName
: The table name where the item should be found.key
: They key of the item you are looking forretryPolicy
: An optional node-retry options config.sls-jest
will retry using the given retry policy until the test passes or all the retries are exhausted. This is useful in an asynchronous context.
toExist()
toExist()
Asserts whether a DynamoDB item exists in the given table.
toExistAndMatchObject<E>(expected: DeepPartial<E>)
toExistAndMatchObject<E>(expected: DeepPartial<E>)
Asserts that an item exists in the given table, and matches a subset of the properties of an object. It works similarly to jest's toMatchObject.
toExistAndMatchSnapshot(propertiesOrHint?: string, hint?: string)
toExistAndMatchSnapshot(propertiesOrHint?: string, hint?: string)
Asserts that an item exists in the given table, and that it matches the most recent snapshot. It works similarly to jest's toMatchSnapshot.
toExistAndMatchInlineSnapshot(propertiesOrHint?: string, hint?: string)
toExistAndMatchInlineSnapshot(propertiesOrHint?: string, hint?: string)
Asserts that an item exists in the given table, and that it matches the most recent inline snapshot. It works similarly to jest's toMatchInlineSnapshot.
Last updated