From d4a5c82c6037392830ade18253bc3159d8f87619 Mon Sep 17 00:00:00 2001 From: James Gregory Date: Tue, 27 Jul 2021 17:12:33 +1000 Subject: [PATCH] fix: lambda tests to use imported aws-sdk version --- src/services/lambda.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/lambda.test.ts b/src/services/lambda.test.ts index 2eaa2190..e365f8f7 100644 --- a/src/services/lambda.test.ts +++ b/src/services/lambda.test.ts @@ -1,6 +1,7 @@ import { MockLogger } from "../__tests__/mockLogger"; import { LambdaService } from "./lambda"; import * as AWS from "aws-sdk"; +import { version } from "aws-sdk/package.json"; describe("Lambda function invoker", () => { let mockLambdaClient: jest.Mocked; @@ -137,7 +138,7 @@ describe("Lambda function invoker", () => { Payload: JSON.stringify({ version: 0, userName: "username", - callerContext: { awsSdkVersion: "2.656.0", clientId: "clientId" }, + callerContext: { awsSdkVersion: version, clientId: "clientId" }, region: "local", userPoolId: "userPoolId", triggerSource: "UserMigration_Authentication", @@ -192,7 +193,7 @@ describe("Lambda function invoker", () => { Payload: JSON.stringify({ version: 0, userName: "username", - callerContext: { awsSdkVersion: "2.656.0", clientId: "clientId" }, + callerContext: { awsSdkVersion: version, clientId: "clientId" }, region: "local", userPoolId: "userPoolId", triggerSource: source,