Files
Talks/e2e/http-routes.spec.js
Le Prévost-Corvellec Arnault 354c8cd9ef Add Makefile, package.json, and initial configuration for VitePress and Slidev integration
- Introduced a Makefile for streamlined commands related to building, running, and managing presentations.
- Created package.json to define project metadata, dependencies, and scripts for development and testing.
- Added .gitignore entries to exclude build artifacts and temporary files from version control.
- Included playwright.config.mjs for end-to-end testing setup with Playwright.
- Added README.md for project documentation, outlining setup instructions and development guidelines.
2026-04-11 15:59:20 +02:00

26 lines
880 B
JavaScript

// @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()
}
})
})