Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async (tableName, dataTable) => {
const expected = dataTable.hashes()
const {Items} = await typeDynamo.dynamoClient.scan({
TableName: tableName,
}).promise()
const itemsInTable = (Items || []).map(
(item) => DynamoDB.Converter.unmarshall(item))
// @ts-ignore
expect(itemsInTable).toEqual(expect.arrayContaining(expected))
})
Then('I should get the following items in any order:', function (dataTable) {
const items = dataTable.hashes()
// @ts-ignore
expect(this.result.data).toEqual(expect.arrayContaining(items))
// @ts-ignore
expect(items).toEqual(expect.arrayContaining(this.result.data))
})
Then('I should get the following items in any order:', function (dataTable) {
const items = dataTable.hashes()
// @ts-ignore
expect(this.result.data).toEqual(expect.arrayContaining(items))
// @ts-ignore
expect(items).toEqual(expect.arrayContaining(this.result.data))
})