From 1c071188b2fafc0dae55d695987ba2f3bc530105 Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Wed, 19 Feb 2025 11:56:35 +0000 Subject: [PATCH] Use test example from JS --- .../aws-sam/features/fixtures/node-app/thrown-error/app.js | 5 +++-- test/e2e/aws-sam/features/invoke.feature | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/aws-sam/features/fixtures/node-app/thrown-error/app.js b/test/e2e/aws-sam/features/fixtures/node-app/thrown-error/app.js index fbe07968..7ca559f1 100644 --- a/test/e2e/aws-sam/features/fixtures/node-app/thrown-error/app.js +++ b/test/e2e/aws-sam/features/fixtures/node-app/thrown-error/app.js @@ -1,3 +1,4 @@ -exports.lambdaHandler = async (event, context) => { - throw new Error('this is an error') +exports.lambdaHandler = (event, context, callback) => { + throw new Error('Oh no!') } + \ No newline at end of file diff --git a/test/e2e/aws-sam/features/invoke.feature b/test/e2e/aws-sam/features/invoke.feature index 72df5295..18085650 100644 --- a/test/e2e/aws-sam/features/invoke.feature +++ b/test/e2e/aws-sam/features/invoke.feature @@ -88,7 +88,7 @@ Scenario: Executing a lambda function that fails with no internal errors Scenario: Executing a lambda function that fails with an internal error Given I invoke the "ThrownErrorFunction" lambda in "features/fixtures/node-app" - Then the lambda response "errorMessage" contains "this is an error" + Then the lambda response "errorMessage" contains "Oh no!" And the lambda response "errorType" equals "Error" And the lambda response "body" is null And the SAM exit code equals 0