1import assert from 'node:assert/strict'2import { readFileSync } from 'node:fs'3import test from 'node:test'45test('loads homepage examples from the shared diagram corpus', () => {6 const moduleSource = readFileSync(new URL('../src/examples.js', import.meta.url), 'utf8')7 assert.match(moduleSource, /\.\.\/\.\.\/\.\.\/examples\/diagrams\//)8 assert.doesNotMatch(moduleSource, /ci\/tests\/diagrams/)9})1011test('keeps example presentation neutral', () => {12 const tikz = readFileSync(new URL('../../../examples/diagrams/tikz.tex', import.meta.url), 'utf8')13 const excalidraw = readFileSync(new URL('../../../examples/diagrams/excalidraw.excalidraw', import.meta.url), 'utf8')14 assert.doesNotMatch(tikz, /documentclass\[[^\]]*border\s*=/i)15 assert.equal(JSON.parse(excalidraw).appState.viewBackgroundColor, undefined)16})1718test('does not turn the Ditaa example into a document shape', () => {19 const moduleSource = readFileSync(new URL('../src/examples.js', import.meta.url), 'utf8')20 assert.doesNotMatch(moduleSource, /\{s\}/)21})