import assert from 'node:assert/strict'; import { after, before, describe, it } from 'node:test'; import * as cheerio from 'cheerio'; import nodejs from '../dist/index.js'; import { loadFixture } from './test-utils.js'; describe('Errors', () => { let fixture; before(async () => { fixture = await loadFixture({ root: './fixtures/errors/', output: 'server', adapter: nodejs({ mode: 'standalone' }), }); await fixture.build(); }); let devPreview; before(async () => { devPreview = await fixture.preview(); }); after(async () => { await devPreview.stop(); }); it( 'rejected promise in template', { skip: true, todo: 'Review the response from the in-stream' }, async () => { const res = await fixture.fetch('/in-stream'); const html = await res.text(); const $ = cheerio.load(html); assert.equal($('p').text().trim(), 'Internal server error'); } ); it( 'generator that throws called in template', { skip: true, todo: 'Review the response from the generator' }, async () => { const result = ['