Skip to content

Commit 210f1c7

Browse files
committed
failing test for #626
1 parent ccb8825 commit 210f1c7

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script context="module">
2+
3+
</script>
4+
5+
<script>
6+
/** @type {number} */
7+
export let status;
8+
9+
/** @type {Error} */
10+
export let error;
11+
</script>
12+
13+
<h1>Nested error page</h1>
14+
<p id="nested-error-status">status: {status}</p>
15+
<p id="nested-error-message">error.message: {error.message}</p>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as assert from 'uvu/assert';
2+
3+
/** @type {import('../../../../../../types').TestMaker} */
4+
export default function (test, is_dev) {
5+
test.only(
6+
'renders the closest error page',
7+
'/errors/nested-error-page',
8+
async ({ page, clicknav }) => {
9+
await clicknav('[href="/errors/nested-error-page/nope"]');
10+
11+
assert.equal(await page.textContent('h1'), 'Nested error page');
12+
assert.equal(await page.textContent('#nested-error-status'), 'status: 500');
13+
assert.equal(await page.textContent('#nested-error-message'), 'error.message: nope');
14+
}
15+
);
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="/errors/nested-error-page/nope">nope</a>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script context="module">
2+
export async function load() {
3+
throw new Error('nope');
4+
}
5+
</script>
6+
7+
<h1>should not see this</h1>

0 commit comments

Comments
 (0)