From 5e9635c4b1730692f806ba4979c9e905355b1c75 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 19 Oct 2020 13:49:13 -0500 Subject: [PATCH] fixing unit tests --- .github/workflows/ci.yml | 2 +- tests/server.test.js | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c7bc7ce..a21cc71f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.18.x] + node-version: [10.x, 12.x] steps: - uses: actions/checkout@v1 diff --git a/tests/server.test.js b/tests/server.test.js index 1456e99d..2b0a8f30 100644 --- a/tests/server.test.js +++ b/tests/server.test.js @@ -35,16 +35,9 @@ test('basic test', async () => { const response = await lambdaServer(app, true)(event); - await expect(response).toEqual({ - body: 'SGVsbG8gV29ybGQh', - headers: { - 'content-length': '12', - 'content-type': 'text/html; charset=utf-8', - date: expect.any(String), - etag: expect.any(String), - 'x-powered-by': 'Express', - }, - isBase64Encoded: true, - statusCode: 200, - }); + await expect(response.body).toEqual('SGVsbG8gV29ybGQh'); + await expect(response.isBase64Encoded).toEqual(true); + await expect(response.statusCode).toEqual(200); + await expect(response.headers['content-length']).toEqual('12'); + await expect(response.headers['content-type']).toEqual('text/html; charset=utf-8'); });