From 1db1f0661080dd043ab0eb22db5e1602f708d1ae Mon Sep 17 00:00:00 2001 From: WangCham <651122857@qq.com> Date: Fri, 9 Oct 2026 15:14:02 +0800 Subject: [PATCH] test: include zh-only articles in static routes --- tests/agent-static-build.test.mjs | 3 ++- tests/fumapress-static-build.test.mjs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/agent-static-build.test.mjs b/tests/agent-static-build.test.mjs index 0abc55a5a..bfa83ff87 100644 --- a/tests/agent-static-build.test.mjs +++ b/tests/agent-static-build.test.mjs @@ -4,6 +4,7 @@ import path from "node:path"; import test from "node:test"; import { unified } from "unified"; import remarkParse from "remark-parse"; +import { zhOnlyArticleRoutes } from "./article-routes.mjs"; const root = path.resolve(import.meta.dirname, ".."); const output = process.env.AGENT_TEST_OUTPUT ?? path.join(root, "dist/public"); @@ -22,7 +23,7 @@ function links(node, result = []) { } test("every sitemap page has meaningful canonical Markdown and HTML discovery", async () => { - assert.equal(urls.length, 482); + assert.equal(urls.length, 482 + zhOnlyArticleRoutes.length); for (const url of urls) { const route = relative(url); const text = await read(`${route}.md`); diff --git a/tests/fumapress-static-build.test.mjs b/tests/fumapress-static-build.test.mjs index 8bac4a859..7a746102d 100644 --- a/tests/fumapress-static-build.test.mjs +++ b/tests/fumapress-static-build.test.mjs @@ -204,6 +204,7 @@ test("canonical sitemap routes match the legacy Mintlify directory structure", a for (const locale of ["en", "zh", "ja"]) { legacy.add(`/${locale}/usage/platforms/mattermost`); } + for (const route of zhOnlyArticleRoutes) legacy.add(`/zh/${route}`); const sitemap = await readFile(path.join(publicRoot, "sitemap.xml"), "utf8"); const actual = new Set([...sitemap.matchAll(/https:\/\/langbot\.app\/docs(\/[^<]+)<\/loc>/g)] .map((match) => decodeURIComponent(match[1]).replace(/\/$/, "")));