From 1d7d3b30220316cdc8e5053ba4147fdfa86a7739 Mon Sep 17 00:00:00 2001 From: xnacly Date: Mon, 30 Aug 2021 16:23:19 +0200 Subject: added first unittests for api endpoints --- api/tests/routes/ping.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 api/tests/routes/ping.test.js (limited to 'api/tests/routes/ping.test.js') diff --git a/api/tests/routes/ping.test.js b/api/tests/routes/ping.test.js new file mode 100644 index 00000000..6fa4b160 --- /dev/null +++ b/api/tests/routes/ping.test.js @@ -0,0 +1,12 @@ +const supertest = require("supertest"); +const request = supertest("http://localhost:3001"); + +describe("/ping", () => { + describe("GET", () => { + test("should return 200 and pong", async () => { + let response = await request.get("/api/ping"); + expect(response.text).toBe("pong"); + expect(response.statusCode).toBe(200); + }); + }); +}); -- cgit 1.5.1