feat: add static sitemap generation script, replace dynamic sitemap with static files

This commit is contained in:
2026-05-09 13:04:33 +08:00
parent d4a12fe19d
commit 5bc85aa850
5 changed files with 2271 additions and 120 deletions
+5 -8
View File
@@ -1,5 +1,6 @@
import { describe, it, expect, vi } from "vitest"
// Mock database to prevent real queries
vi.mock("@/lib/db/index", () => ({
db: {
select: vi.fn().mockReturnValue({
@@ -22,13 +23,9 @@ vi.mock("drizzle-orm", () => ({
}))
describe("Sitemap Generator", () => {
it("exports dynamic = force-dynamic", async () => {
it("default export returns empty array (static sitemap is in public/)", async () => {
const mod = await import("@/app/sitemap")
expect(mod.dynamic).toBe("force-dynamic")
const result = mod.default()
expect(result).toEqual([])
})
it("default export is a function", async () => {
const mod = await import("@/app/sitemap")
expect(typeof mod.default).toBe("function")
})
})
})