Skip to content

Commit 73d88e8

Browse files
Merge pull request #45 from Special7ka/feat/health-test
test: add smoke test for GET / endpoint
2 parents 581a7e9 + 6c8ca58 commit 73d88e8

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

backend/tests/health.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
const app = require('../app')
3+
const request = require('supertest')
4+
5+
6+
describe("Health endpoint test and health payload",()=>{
7+
it("GET / return 200",async()=>{
8+
const res = await request(app).get("/");
9+
10+
expect(res.status).toBe(200);
11+
expect(res.body).toEqual({
12+
status: "success",
13+
message: "urBackend API is running 🚀"
14+
})
15+
})
16+
})

backend/tests/jest.setup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
process.env.REDIS_URL = "redis://localhost:6379"
3+
4+
25
jest.mock('ioredis', () => {
36
const Redis = jest.fn().mockImplementation(() => ({
47
on: jest.fn(),

0 commit comments

Comments
 (0)