Skip to content

Commit 8fb872b

Browse files
committed
fix test
1 parent ceb555c commit 8fb872b

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

packages/kit/test/apps/basics/src/hooks.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ export const handle = sequence(
3131
return resolve(request);
3232
},
3333
async ({ request, resolve }) => {
34-
if (request.url.pathname === '/errors/error-in-handle') {
34+
const pathname = request.url.pathname;
35+
if (pathname === '/errors/error-in-handle') {
3536
throw new Error('Error in handle');
3637
}
3738

3839
const response = await resolve(request, {
39-
hydrate:
40-
request.url.pathname !== '/no-hydrate' && request.url.pathname !== '/no-hydrate/no-js',
41-
router:
42-
request.url.pathname !== '/no-router/a' && request.url.pathname !== '/no-hydrate/no-js',
40+
hydrate: pathname !== '/no-hydrate' && pathname !== '/no-hydrate/no-js',
41+
router: pathname !== '/no-router/a' && pathname !== '/no-hydrate/no-js',
4342
ssr: !request.url.pathname.startsWith('/no-ssr')
4443
});
4544

packages/kit/test/apps/basics/src/routes/no-router/__layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<a href="/no-router/a">a</a>
1010
<a href="/no-router/b">b</a>
1111

12-
<slot></slot>
12+
<slot></slot>
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
<script context="module">
2-
export const router = false;
1+
<script>
2+
import { beforeNavigate } from '$app/navigation';
3+
4+
beforeNavigate(({ cancel }) => {
5+
cancel();
6+
});
37
</script>
48

5-
<h1>a</h1>
9+
<h1>a</h1>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<h1>b</h1>
1+
<h1>b</h1>

packages/kit/test/apps/basics/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ test.describe.parallel('Nested layouts', () => {
11041104
});
11051105
});
11061106

1107-
test.describe.parallel('Page options', () => {
1107+
test.describe.parallel('Resolve options', () => {
11081108
test('does not hydrate page with hydrate=false', async ({ page, javaScriptEnabled }) => {
11091109
await page.goto('/no-hydrate');
11101110

0 commit comments

Comments
 (0)