Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jan 18, 2022
1 parent ceb555c commit 8fb872b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
9 changes: 4 additions & 5 deletions packages/kit/test/apps/basics/src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ export const handle = sequence(
return resolve(request);
},
async ({ request, resolve }) => {
if (request.url.pathname === '/errors/error-in-handle') {
const pathname = request.url.pathname;
if (pathname === '/errors/error-in-handle') {
throw new Error('Error in handle');
}

const response = await resolve(request, {
hydrate:
request.url.pathname !== '/no-hydrate' && request.url.pathname !== '/no-hydrate/no-js',
router:
request.url.pathname !== '/no-router/a' && request.url.pathname !== '/no-hydrate/no-js',
hydrate: pathname !== '/no-hydrate' && pathname !== '/no-hydrate/no-js',
router: pathname !== '/no-router/a' && pathname !== '/no-hydrate/no-js',
ssr: !request.url.pathname.startsWith('/no-ssr')
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<a href="/no-router/a">a</a>
<a href="/no-router/b">b</a>

<slot></slot>
<slot></slot>
10 changes: 7 additions & 3 deletions packages/kit/test/apps/basics/src/routes/no-router/a.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script context="module">
export const router = false;
<script>
import { beforeNavigate } from '$app/navigation';
beforeNavigate(({ cancel }) => {
cancel();
});
</script>

<h1>a</h1>
<h1>a</h1>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1>b</h1>
<h1>b</h1>
2 changes: 1 addition & 1 deletion packages/kit/test/apps/basics/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ test.describe.parallel('Nested layouts', () => {
});
});

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

Expand Down

0 comments on commit 8fb872b

Please sign in to comment.