@@ -6,7 +6,7 @@ app.use(express.json());
|
|||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
res.json({
|
res.json({
|
||||||
status: "OK",
|
status: "OK",
|
||||||
message: "Home Route Working"
|
message: "Home Route Working Fine"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ app.get("/health", (req, res) => {
|
|||||||
|
|
||||||
module.exports = app;
|
module.exports = app;
|
||||||
|
|
||||||
|
|
||||||
// only start server if not testing
|
// only start server if not testing
|
||||||
// It ensures the server starts only when the file is run directly, not when it is imported for testing.
|
// It ensures the server starts only when the file is run directly, not when it is imported for testing.
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ describe("API Testing", () => {
|
|||||||
|
|
||||||
test("GET / should return status ok", async () => {
|
test("GET / should return status ok", async () => {
|
||||||
const res = await request(app).get("/");
|
const res = await request(app).get("/");
|
||||||
expect(res.body.status).toBe("ok");
|
expect(res.body.status).toBe("OK");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("GET /health should return status OK", async () => {
|
test("GET /health should return status OK", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user