From 02f4e0148ce5cfe753e0f7f3a58df06ae4f99bfe Mon Sep 17 00:00:00 2001 From: Mariusz Nowak Date: Mon, 4 Oct 2021 14:42:19 +0200 Subject: [PATCH] test(AWS Lambda): Refactor to async/await --- test/integration/aws/function.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/aws/function.test.js b/test/integration/aws/function.test.js index cd1670d8c..0f815a284 100644 --- a/test/integration/aws/function.test.js +++ b/test/integration/aws/function.test.js @@ -38,8 +38,8 @@ describe('test/integration/aws/function.test.js', function () { await removeService(serviceDir); }); - it('on async invoke should invoke destination target', async () => - confirmCloudWatchLogs( + it('on async invoke should invoke destination target', async () => { + const events = await confirmCloudWatchLogs( `/aws/lambda/${stackName}-target`, async () => { await awsRequest('Lambda', 'invoke', { @@ -47,8 +47,8 @@ describe('test/integration/aws/function.test.js', function () { InvocationType: 'Event', }); }, - { checkIsComplete: (events) => events.length } - ).then((events) => { - expect(events.length > 0).to.equal(true); - })); + { checkIsComplete: (soFarEvents) => soFarEvents.length } + ); + expect(events.length > 0).to.equal(true); + }); });