/** * Test fixture: a hook that writes a post-mortem set to its artifact * directory, the way a browser-driven check does — a screenshot, the page * content, and the observed requests. * * Three files with three different extensions on purpose: the executor * used to report only the newest `.png`, which silently discarded the two * that make the screenshot diagnosable. */ import { writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { defineHook } from '@celilo/capabilities'; export default defineHook({ hook: 'container_created', requires: [], handler: async (ctx) => { const dir = ctx.screenshotDir as string; writeFileSync(join(dir, 'spa-failure.png'), 'not-really-a-png'); writeFileSync(join(dir, 'spa-failure.html'), ''); writeFileSync(join(dir, 'spa-failure.requests.txt'), 'GET /api/getActiveMonth 200'); }, });