Skip to content

Commit

Permalink
run test only in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jan 9, 2024
1 parent a86538f commit d7fcbf2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/kit/test/apps/basics/test/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ test.describe('Load', () => {
expect(await page.textContent('h2')).toBe('x: b: 4');
});

test('accessing url.hash from load errors and suggests using page store', async ({ page }) => {
await page.goto('/load/url-hash#please-dont-send-me-to-load');
expect(await page.textContent('#message')).toBe(
'This is your custom error page saying: "Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead (500 Internal Error)"'
);
});
if (process.env.DEV) {
test('accessing url.hash from load errors and suggests using page store', async ({ page }) => {
await page.goto('/load/url-hash#please-dont-send-me-to-load');
expect(await page.textContent('#message')).toBe(
'This is your custom error page saying: "Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead (500 Internal Error)"'
);
});
}

test('url instance methods work in load', async ({ page }) => {
await page.goto('/load/url-to-string');
Expand Down

0 comments on commit d7fcbf2

Please sign in to comment.