From 8409d61e29e96504785568e27f72551e946f4a96 Mon Sep 17 00:00:00 2001 From: Mariusz Nowak Date: Thu, 24 Sep 2020 16:09:19 +0200 Subject: [PATCH] test(AWS Cognito): Improve logs handling --- test/integration/cognitoUserPool.test.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/integration/cognitoUserPool.test.js b/test/integration/cognitoUserPool.test.js index 3d06a727662..3e06bb7c23c 100644 --- a/test/integration/cognitoUserPool.test.js +++ b/test/integration/cognitoUserPool.test.js @@ -93,7 +93,13 @@ describe('AWS - Cognito User Pool Integration Test', function() { await createUser(userPoolId, 'janedoe', '!!!wAsD123456wAsD!!!'); const events = await confirmCloudWatchLogs( `/aws/lambda/${stackName}-${functionName}`, - async () => {} + async () => {}, + { + checkIsComplete: soFarEvents => { + const logs = soFarEvents.reduce((data, event) => data + event.message, ''); + return logs.includes('userName'); + }, + } ); const logs = events.reduce((data, event) => data + event.message, '');