From ad838cb5692defbb8a30e0b3cac85bbfd3a23a0f Mon Sep 17 00:00:00 2001 From: Paul Rowe Date: Sun, 29 Sep 2024 19:52:48 -0500 Subject: [PATCH] changing response --- .github/workflows/main.yml | 3 +++ hello-world/hello-world.js | 4 ++-- hello-world/hello-world.spec.js | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f93f37e..f97e0a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,9 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: run-tests: diff --git a/hello-world/hello-world.js b/hello-world/hello-world.js index 7f6556b..d94c023 100644 --- a/hello-world/hello-world.js +++ b/hello-world/hello-world.js @@ -1,5 +1,5 @@ -export function handler(event) { +export function handler() { return { - body: "Hello World", + message: "Hello World", }; } diff --git a/hello-world/hello-world.spec.js b/hello-world/hello-world.spec.js index 38a4641..a6a494d 100644 --- a/hello-world/hello-world.spec.js +++ b/hello-world/hello-world.spec.js @@ -3,5 +3,7 @@ import { handler } from "./hello-world"; it("should return the greeting", async () => { var resp = await handler({}); - expect(resp.body).toEqual("Hello World"); + expect(resp).toEqual({ + message: "Hello World", + }); });