import { test } from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync, existsSync } from 'node:fs'; const homepage = () => readFileSync(new URL('../src/Homepage.tsx', import.meta.url), 'utf8'); test('homepage focuses on text, single-image posts, and post replies with no carousels', () => { const text = homepage(); assert.doesNotMatch(text, /carousel/i); assert.match(text, /Paste a post/); assert.doesNotMatch(text.replace(/className="[^"]*"|tweet:|\.tweet|TweetHead|e\.tweet|example\.tweet/g, ''), /tweet/i); assert.match(text, /single-image posts/i); assert.doesNotMatch(text, /bring your own API key|OpenAI|Claude|Codex|Gemini|gpt-image/i); const diagram = readFileSync(new URL('../src/SyncDiagram.tsx', import.meta.url), 'utf8'); assert.doesNotMatch(diagram, /\bMCP\b|external agent/i); assert.match(diagram, /Hosted AI is not enabled/); }); test('website contains no authentication, database, waitlist submission, or tracker integration', () => { const text = homepage(); assert.doesNotMatch(text, /Turnstile|\/api\/|\/auth\/|supabase|process\.env|fetch\(/i); assert.doesNotMatch(text, / { const text = homepage(); assert.match(text, /Apple Silicon/); assert.match(text, /iPhone & iPad/); assert.doesNotMatch(text, /windows|linux/i); for (const file of ['../src/Legal.tsx', '../index.html', '../scripts/seo.mjs']) assert.doesNotMatch(readFileSync(new URL(file, import.meta.url), 'utf8'), /windows|linux/i); assert.match(text, /Inkspring \d+\.\d+\.\d+ is available for Mac/); assert.match(text, /No Inkspring account/); }); test('site says Inkspring is free and links to its public source', () => { const text = homepage(); assert.match(text, /Free to use/); assert.match(text, /https:\/\/github\.com\/projectatomai\/inkspring/); assert.match(readFileSync(new URL('../scripts/seo.mjs', import.meta.url), 'utf8'), /Open source/); }); test('active product pages advertise only official publishing channels and no public scraping', () => { const files = ['../src/Homepage.tsx', '../src/Socials.tsx', '../src/Help.tsx', '../src/Legal.tsx', '../src/faq.js', '../scripts/seo.mjs', '../public/llms.txt']; const text = files.map(file => readFileSync(new URL(file, import.meta.url), 'utf8')).join('\n'); assert.doesNotMatch(text, /apify|scraping|reddit|tiktok|substack|youtube|bearer token/i); assert.match(text, /official APIs/); const social = readFileSync(new URL('../src/Socials.tsx', import.meta.url), 'utf8'); assert.deepEqual([...social.matchAll(/\{ id: '([^']+)', name:/g)].map(m => m[1]).sort(), ['instagram','linkedin','x']); assert.match(text, /media hosting/i); });