fix(api): дублировать маршруты под /api и убрать Content-Type у GET
Some checks failed
CI / build-and-test (pull_request) Has been cancelled

This commit is contained in:
Anton
2026-04-08 10:20:17 +03:00
parent 7e9c20d4bf
commit 53b9561a54
5 changed files with 21 additions and 22 deletions

View File

@@ -12,6 +12,11 @@ test("GET /health returns ok", async () => {
assert.ok(res.body.version.length > 0);
});
test("GET /api/health returns ok (prefix without proxy strip)", async () => {
const res = await request(app).get("/api/health").expect(200);
assert.equal(res.body.status, "ok");
});
test("GET /ready succeeds with mock database", async () => {
const res = await request(app).get("/ready").expect(200);
assert.equal(res.body.status, "ready");
@@ -34,6 +39,11 @@ test("GET /races accepts year and month", async () => {
assert.ok(Array.isArray(res.body));
});
test("GET /api/races mirrors GET /races", async () => {
const res = await request(app).get("/api/races?year=2026&month=5").expect(200);
assert.ok(Array.isArray(res.body));
});
test("GET /races/:id returns not_found", async () => {
const res = await request(app).get("/races/does-not-exist").expect(404);
assert.equal(res.body.error, "not_found");