Skip to content

Commit

Permalink
chore: vite 5 test compatibility (#10896)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Oct 20, 2023
1 parent fb611ef commit b196712
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
6 changes: 0 additions & 6 deletions packages/kit/test/apps/basics/src/routes/assets/+page.svelte

This file was deleted.

1 change: 0 additions & 1 deletion packages/kit/test/apps/basics/src/routes/assets/logo.svg

This file was deleted.

6 changes: 3 additions & 3 deletions packages/kit/test/apps/basics/test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,13 @@ test.describe('Static files', () => {
});

test('Vite serves assets in allowed directories', async ({ page, request }) => {
await page.goto('/assets');
const path = await page.textContent('h1');
await page.goto('/asset-import');
const path = await page.getAttribute('img[alt=potatoes]', 'src');
if (!path) throw new Error('Could not determine path');

const r1 = await request.get(path);
expect(r1.status()).toBe(200);
expect(await r1.text()).toContain('http://www.w3.org/2000/svg');
expect(await r1.text()).toBeTruthy();

// check that we can fetch a route which overlaps with the name of a file
const r2 = await request.get('/package.json');
Expand Down
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 @@ -29,7 +29,7 @@ test.describe('Imports', () => {
]);
} else {
expect(sources[0].startsWith('data:image/png;base64,')).toBeTruthy();
expect(sources[1]).toBe(`${baseURL}/_app/immutable/assets/large.3183867c.jpg`);
expect(sources[1]).toMatch(/\/_app\/immutable\/assets\/large\.[\w-]+\.jpg/);
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/test/apps/options-2/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe('Service worker', () => {
});

expect(self.base).toBe('/basepath');
expect(self.build[0]).toMatch(/\/basepath\/_app\/immutable\/entry\/start\.[a-z0-9]+\.js/);
expect(self.build[0]).toMatch(/\/basepath\/_app\/immutable\/entry\/start\.[\w-]+\.js/);
});

test('does not register /basepath/service-worker.js', async ({ page }) => {
Expand Down

0 comments on commit b196712

Please sign in to comment.