feat: backend rebuild
This commit is contained in:
15
backend/tests/health.test.js
Normal file
15
backend/tests/health.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import app from "../src/index.js"; // สมมติว่าคุณ export app จาก src/index.js
|
||||
import request from "supertest";
|
||||
|
||||
// ปิด server หลังจากเทสเสร็จ
|
||||
afterAll((done) => {
|
||||
app.server.close(done);
|
||||
});
|
||||
|
||||
describe("GET /health", () => {
|
||||
it("should respond with 200 OK and a health message", async () => {
|
||||
const response = await request(app).get("/health");
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(response.text).toContain("Backend is healthy");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user