- 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.
32 lines
1.3 KiB
JavaScript
32 lines
1.3 KiB
JavaScript
/**
|
|
* Après npm run build : dist-portal + dist-<slug>/ à la racine.
|
|
*/
|
|
import { test, describe } from 'node:test'
|
|
import assert from 'node:assert'
|
|
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
const repoRoot = path.resolve(__dirname, '..')
|
|
const portal = path.join(repoRoot, 'dist-portal')
|
|
const hasPortal = fs.existsSync(portal)
|
|
|
|
describe('Artefacts build (dist-portal + dist-<slug>)', () => {
|
|
test('portail + chaque deck', { skip: !hasPortal }, () => {
|
|
assert.ok(fs.existsSync(path.join(portal, 'index.html')))
|
|
assert.ok(fs.existsSync(path.join(portal, 'presentations', 'index.html')))
|
|
|
|
const data = JSON.parse(
|
|
fs.readFileSync(path.join(repoRoot, 'portal', '.vitepress', 'data', 'presentations.json'), 'utf8'),
|
|
)
|
|
for (const p of data) {
|
|
const slideRoot = path.join(repoRoot, `dist-${p.slug}`)
|
|
const slideIndex = path.join(slideRoot, 'index.html')
|
|
assert.ok(fs.existsSync(slideIndex), `deck manquant: dist-${p.slug}/index.html`)
|
|
const presIndex = path.join(portal, 'presentations', p.slug, 'index.html')
|
|
assert.ok(fs.existsSync(presIndex), `fiche manquante: dist-portal/presentations/${p.slug}/index.html`)
|
|
}
|
|
})
|
|
})
|