diff --git a/lib/__tests__/watcher-handler.test.ts b/lib/__tests__/watcher-handler.test.ts index ee59da0f..996b26cc 100644 --- a/lib/__tests__/watcher-handler.test.ts +++ b/lib/__tests__/watcher-handler.test.ts @@ -11,9 +11,7 @@ describe('watcher-handler', () => { test('throws an error if PutMetricData fails', async () => { expect.assertions(1); cloudwatch.putMetricData = jest.fn(_request => { - return { - promise: () => new Promise((_, reject) => reject(new Error('fail'))), - }; + return new Promise((_, reject) => reject(new Error('fail'))); }) as any; try { await handler(actionExecutionEvent()); diff --git a/lib/pipeline-watcher/handler/watcher-handler.ts b/lib/pipeline-watcher/handler/watcher-handler.ts index cfeacebe..97e4ac26 100644 --- a/lib/pipeline-watcher/handler/watcher-handler.ts +++ b/lib/pipeline-watcher/handler/watcher-handler.ts @@ -1,6 +1,7 @@ // eslint-disable-next-line import/no-extraneous-dependencies +// eslint-disable-next-line import/no-extraneous-dependencies import { CloudWatch, Dimension, PutMetricDataCommandInput } from '@aws-sdk/client-cloudwatch'; // Partial type for the 'detail' section of an event from Amazon EventBridge for 'CodePipeline Execution State Change'