forked from Lilly-Protocol/lily-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache-control.test.ts
More file actions
27 lines (22 loc) · 992 Bytes
/
Copy pathcache-control.test.ts
File metadata and controls
27 lines (22 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { describe, it, expect } from "vitest";
import request from "supertest";
import { createApp } from "../src/app";
describe("Cache-Control: no-store (issue #76)", () => {
const app = createApp();
it("should set Cache-Control: no-store on root route", async () => {
const res = await request(app).get("/");
expect(res.headers["cache-control"]).toBe("no-store");
});
it("should set Cache-Control: no-store on health endpoint", async () => {
const res = await request(app).get("/api/v1/health");
expect(res.headers["cache-control"]).toBe("no-store");
});
it("should set Cache-Control: no-store on agents endpoint", async () => {
const res = await request(app).get("/api/v1/agents");
expect(res.headers["cache-control"]).toBe("no-store");
});
it("should set Cache-Control: no-store on 404 responses", async () => {
const res = await request(app).get("/nonexistent-route");
expect(res.headers["cache-control"]).toBe("no-store");
});
});