Files
probably-rendering-one-more…/apps/wiki/tests/wiki.test.ts
T
codex-bot a2330b22e2
python CI and deployment / verify-and-deploy (push) Successful in 7m23s
studio CI and deployment / verify-and-deploy (push) Failing after 5m28s
wiki CI and deployment / verify-and-deploy (push) Failing after 6m13s
Restructure into Wiki, Studio and Python monorepo with scoped CI
2026-10-25 21:13:43 +08:00

6 lines
774 B
TypeScript

import {test} from 'node:test';
import assert from 'node:assert/strict';
import {wikiPages,findWikiPage,wikiMarkdown,wikiPath} from '../src/content/wiki';
test('every wiki card resolves to the same AI-visible page',()=>{for(const page of wikiPages){const key=page.namespace+':'+page.slug;assert.equal(findWikiPage(key),page);assert.ok(wikiMarkdown(page).includes(page.body));assert.equal(decodeURIComponent(wikiPath(page)),'/wiki/'+key);}});
test('category membership crosses namespaces and rejects unknown categories',()=>{const page=findWikiPage('Category:创作方法');assert.ok(page?.body.includes('Main:'));assert.ok(page?.body.includes('Template:'));assert.equal(findWikiPage('Category:missing'),undefined);assert.equal(findWikiPage('Unknown:welcome'),undefined);});