Download packages/schema-engine/tests/docs/documentation-snapshot.test.ts from AnthropicallyHuggingFaces/ProjectOS: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/spaces/AnthropicallyHuggingFaces/ProjectOS/resolve/main/packages/schema-engine/tests/docs/documentation-snapshot.test.ts
- Command line
-
hf download hf://spaces/AnthropicallyHuggingFaces/ProjectOS/packages/schema-engine/tests/docs/documentation-snapshot.test.ts
-
curl -L -o documentation-snapshot.test.ts https://huggingface.co/spaces/AnthropicallyHuggingFaces/ProjectOS/resolve/main/packages/schema-engine/tests/docs/documentation-snapshot.test.ts
1.75 kB
| import assert from 'node:assert/strict'; | |
| import { readFile } from 'node:fs/promises'; | |
| import { test } from 'node:test'; | |
| import { generateDocumentation, type DocumentationInput } from '../../src/generators/documentation.js'; | |
| const normalizeNewlines = (value: string) => value.replace(/\r\n/g, '\n'); | |
| const input = { | |
| project: { | |
| name: 'Fixture', version: '1.0', mode: 'local', | |
| steps: [{ name: 'Question', description: 'Submit task', capabilities: [] }], | |
| stages: [{ name: 'Research', description: 'Discover', capabilities: [] }], | |
| fabrics: [{ name: 'Storage', description: 'Persist records', capabilities: [] }], | |
| agents: [], councils: [], governance: [], knowledge: [], runtime: {}, storage: {}, models: {}, workspaces: {}, permissions: [] | |
| }, | |
| storage: { | |
| providers: ['SQLite'], vectorStores: [{ provider: 'sqlite-vec', dimensions: 1536 }], | |
| retention: { snapshotDays: 90, archiveYears: 7, keepCanonForever: true }, | |
| migration: { autoMigrate: true, backupBeforeMigration: true, validateSchema: true } | |
| }, | |
| symbols: { ProjectRepository: ['IProjectRepository'] }, | |
| bootstrap: { schema: 'schemas/ProjectOS.xsd', schematron: 'schemas/ProjectOS.sch', output: 'configs' } | |
| } as unknown as DocumentationInput; | |
| for (const [name, file] of [['Architecture', 'ARCHITECTURE.md'], ['Storage', 'STORAGE.md']] as const) { | |
| test(`${name} documentation matches its generated snapshot`, async () => { | |
| const generated = generateDocumentation(input, [name])[`docs/${file}`]; | |
| const expected = await readFile(new URL(`./snapshots/${file}`, import.meta.url), 'utf8'); | |
| // CI runners may check out snapshots with CRLF; compare on LF only. | |
| assert.equal(normalizeNewlines(generated), normalizeNewlines(expected)); | |
| }); | |
| } | |