import assert from 'node:assert/strict'; import test from 'node:test'; import { renderLlmsTxt, renderRobotsTxt, renderSitemapXml, } from './mindspace-seo-discovery-service.mjs'; test('renderSitemapXml emits only provided urls', () => { const xml = renderSitemapXml( [{ publicUrl: '/u/john/pages/demo', updatedAt: Date.parse('2026-08-01T00:00:00.000Z') }], { origin: 'https://m.tkmind.cn' }, ); assert.match(xml, /https:\/\/m\.tkmind\.cn\/u\/john\/pages\/demo<\/loc>/); }); test('renderRobotsTxt references sitemap when enabled', () => { const body = renderRobotsTxt({ origin: 'https://m.tkmind.cn', sitemapEnabled: true, llmsTxtEnabled: true, }); assert.match(body, /Sitemap: https:\/\/m\.tkmind\.cn\/sitemap\.xml/); assert.match(body, /llms\.txt/); }); test('renderLlmsTxt lists markdown links', () => { const body = renderLlmsTxt( [{ publicUrl: '/u/john/pages/demo', summary: '仙居玩水' }], { origin: 'https://m.tkmind.cn' }, ); assert.match(body, /\[仙居玩水\]\(https:\/\/m\.tkmind\.cn\/u\/john\/pages\/demo\)/); });