This commit is contained in:
33
test.js
33
test.js
@@ -1,9 +1,26 @@
|
||||
console.log("Running CI test...");
|
||||
// console.log("Running CI test...");
|
||||
|
||||
if (1 + 1 === 2) {
|
||||
console.log("✅ TEST PASSED");
|
||||
process.exit(0);
|
||||
} else {
|
||||
console.log("❌ TEST FAILED");
|
||||
process.exit(1);
|
||||
}
|
||||
// if (1 + 1 === 2) {
|
||||
// console.log("✅ TEST PASSED");
|
||||
// process.exit(0);
|
||||
// } else {
|
||||
// console.log("❌ TEST FAILED");
|
||||
// process.exit(1);
|
||||
// }
|
||||
|
||||
const request = require("supertest");
|
||||
const app = require("./index");
|
||||
|
||||
describe("API Testing", () => {
|
||||
|
||||
test("GET / should return home message", async () => {
|
||||
const res = await request(app).get("/");
|
||||
expect(res.text).toBe("🚀 Home Route Working");
|
||||
});
|
||||
|
||||
test("GET /health should return status OK", async () => {
|
||||
const res = await request(app).get("/health");
|
||||
expect(res.body.status).toBe("OK");
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user