mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 12:04:39 +00:00
3
test/apps/errors/src/routes/async-throw.json.js
Normal file
3
test/apps/errors/src/routes/async-throw.json.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export async function get(req, res) {
|
||||
throw new Error('oops');
|
||||
}
|
||||
@@ -112,6 +112,15 @@ describe('errors', function() {
|
||||
);
|
||||
});
|
||||
|
||||
it('does not serve error page for async non-page error', async () => {
|
||||
await page.goto(`${base}/async-throw.json`);
|
||||
|
||||
assert.equal(
|
||||
await page.evaluate(() => document.body.textContent),
|
||||
'oops'
|
||||
);
|
||||
});
|
||||
|
||||
it('clears props.error on successful render', async () => {
|
||||
await page.goto(`${base}/no-error`);
|
||||
await start();
|
||||
|
||||
Reference in New Issue
Block a user