Chore: homepage tests (#6278)

This commit is contained in:
shamoon
2026-02-04 19:58:39 -08:00
committed by GitHub
parent 7d019185a3
commit 872a3600aa
558 changed files with 32606 additions and 84 deletions

View File

@@ -0,0 +1,36 @@
import { vi } from "vitest";
export default function createMockRes() {
const res = {
statusCode: null,
body: null,
headers: {},
};
res.status = vi.fn((code) => {
res.statusCode = code;
return res;
});
res.json = vi.fn((body) => {
res.body = body;
return res;
});
res.send = vi.fn((body) => {
res.body = body;
return res;
});
res.end = vi.fn((body) => {
res.body = body;
return res;
});
res.setHeader = vi.fn((key, value) => {
res.headers[key] = value;
return res;
});
return res;
}