// @ts-check import { readFileSync } from 'fs' import { join as pathJoin } from 'path' import { test, expect } from '@playwright/test' const presJson = pathJoin(process.cwd(), 'portal', '.vitepress', 'data', 'presentations.json') const SLUGS = JSON.parse(readFileSync(presJson, 'utf8')).map((p) => p.slug) const ROUTES = ['/', '/presentations/', ...SLUGS.map((s) => `/presentations/${s}/`)] test.describe('HTTP / routes statiques', () => { for (const route of ROUTES) { test(`GET ${route} → 200`, async ({ request }) => { const res = await request.get(route) expect(res.ok(), await res.text()).toBeTruthy() }) } test('GET slides decks → 200', async ({ request }) => { for (const slug of SLUGS) { const res = await request.get(`/slides/${slug}/1`) expect(res.ok(), `slides ${slug}: ${await res.text()}`).toBeTruthy() } }) })