- 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.
26 lines
880 B
JavaScript
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()
|
|
}
|
|
})
|
|
})
|