From 2dd654e1f5b2f78c3694b9ed28bf25a8e56c6a9f Mon Sep 17 00:00:00 2001 From: Remi Date: Tue, 12 Jan 2021 18:42:19 +0100 Subject: [PATCH] fix(catalog-backend): listAccounts mocked implementation --- .../AwsOrganizationCloudAccountProcessor.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/AwsOrganizationCloudAccountProcessor.test.ts b/plugins/catalog-backend/src/ingestion/processors/AwsOrganizationCloudAccountProcessor.test.ts index b67ec17862..5044a16aea 100644 --- a/plugins/catalog-backend/src/ingestion/processors/AwsOrganizationCloudAccountProcessor.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/AwsOrganizationCloudAccountProcessor.test.ts @@ -27,8 +27,8 @@ describe('AwsOrganizationCloudAccountProcessor', () => { afterEach(() => jest.resetAllMocks()); it('generates component entities for accounts', async () => { - listAccounts.mockImplementation(() => { - return { + listAccounts.mockImplementation(() => + Promise.resolve({ Accounts: [ { Arn: @@ -37,8 +37,8 @@ describe('AwsOrganizationCloudAccountProcessor', () => { }, ], NextToken: undefined, - }; - }); + }), + ); await processor.readLocation(location, false, emit); expect(emit).toBeCalledWith({ type: 'entity', @@ -67,8 +67,8 @@ describe('AwsOrganizationCloudAccountProcessor', () => { it('filters out accounts not in specified location target', async () => { const location = { type: 'aws-cloud-accounts', target: 'o-1vl18kc5a3' }; - listAccounts.mockImplementation(() => { - return { + listAccounts.mockImplementation(() => + Promise.resolve({ Accounts: [ { Arn: @@ -82,8 +82,8 @@ describe('AwsOrganizationCloudAccountProcessor', () => { }, ], NextToken: undefined, - }; - }); + }), + ); await processor.readLocation(location, false, emit); expect(emit).toBeCalledTimes(1); expect(emit).toBeCalledWith({