Skip to content

Commit

Permalink
test(AWS SQS): Improve test reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jul 8, 2021
1 parent 780a67a commit a2f7c00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/integration/aws/sqs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ describe('AWS - SQS Integration Test', function () {
const functionName = 'sqsBasic';
const message = 'Hello from SQS!';

return confirmCloudWatchLogs(`/aws/lambda/${stackName}-${functionName}`, () =>
sendSqsMessage(queueName, message)
return confirmCloudWatchLogs(
`/aws/lambda/${stackName}-${functionName}`,
() => sendSqsMessage(queueName, message),
{
checkIsComplete: (events) =>
events.reduce((data, event) => data + event.message, '').includes(message),
}
).then((events) => {
const logs = events.reduce((data, event) => data + event.message, '');
expect(logs).to.include(functionName);
Expand Down

0 comments on commit a2f7c00

Please sign in to comment.