Skip to content

Commit

Permalink
hope this works
Browse files Browse the repository at this point in the history
  • Loading branch information
eltigerchino committed May 3, 2024
1 parent e387ab7 commit c09300e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/kit/test/apps/basics/test/cross-platform/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,13 +881,16 @@ test.describe('Load', () => {
test.describe('Vite', () => {
if (process.env.DEV) {
test('optimizes dependencies', async ({ page }) => {
// wait for Vite to optimize dependencies (otherwise the test fails for Ubuntu firefox)
await page.waitForTimeout(1000);
// wait for the browser to load the home page
await page.goto('/');
let load_count = 0;
page.on('load', () => {
page.on('domcontentloaded', () => {
load_count++;
});
await page.goto('/optimize-deps', { waitUntil: 'load' });
expect(load_count).toBe(0);
// then navigate to the page that has a client-side dependency and expect
// no re-optimisation to happen
await page.goto('/optimize-deps');
expect(load_count).toBe(1);
});
}
Expand Down

0 comments on commit c09300e

Please sign in to comment.