async function assertProducesLogs(t, logs) {
    /** @type {TestContext<TestContextMetadata>} */
    const { metadata } = context(t);

    const uri = `http://localhost:${metadata.port}/index.html`;

    // Verify in the browser
    const page = await browser.newPage();

    page.on('request', req => metadata.logEvents.push(`[browser request] ${req.url()}`));
    page.on('console', msg =>
        metadata.logEvents.push(`[browser console] ${msg.type()}: ${msg.text()}`)
    );

    /** @type Promise<import('playwright').ConsoleMessage | import('playwright').Response | null>[] */
    const events = [];

    events.push(
        ...logs.map(log =>
            page.waitForEvent('console', {
                predicate: msg => msg.text() === log,
                timeout: 10000
            })
        )
    );

    events.push(page.goto(uri));

    await Promise.all(events);

    t.pass();
}
@param {import('ava').ExecutionContext} t
@param {string[]} logs