Skip to content

Commit 796d1e7

Browse files
authored
chore: fix Vite ecosystem CI test (#15516)
This PR fixes our treeshaking tests so that it specifically looks for `import { dev }`, etc. instead of just "dev". This helps avoid false-positive test failures due to the component path being injected as a comment in the build output that includes the export name we're trying to assert isn't there See https://github.com/vitejs/vite-ecosystem-ci/actions/runs/22842250417/job/66257394232#step:7:3065 It also bumps the Vite 8 beta we use in CI to the latest one to catch this issue. You can see from the test run that it now includes the source file path in the build output as a comment https://github.com/sveltejs/kit/actions/runs/22846427091/job/66263863728?pr=15517#step:10:584 --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [ ] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [ ] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [ ] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [ ] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
1 parent d3387f9 commit 796d1e7

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,7 @@ test.describe('$app/environment', () => {
888888
path.join(root, '.svelte-kit/output/server/entries/pages/treeshaking/dev/_page.svelte.js'),
889889
'utf-8'
890890
);
891-
// check that import { dev } from '$app/environment' is treeshaken
892-
expect(code).not.toContain('dev');
891+
expect(code).not.toContain('not prod');
893892
});
894893

895894
test('treeshakes browser check', async () => {
@@ -902,8 +901,7 @@ test.describe('$app/environment', () => {
902901
),
903902
'utf-8'
904903
);
905-
// check that import { browser } from '$app/environment' is treeshaken
906-
expect(code).not.toContain('browser');
904+
expect(code).not.toMatch('client');
907905
});
908906
});
909907

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ catalogs:
5959
'@sveltejs/vite-plugin-svelte': ^4.0.0
6060
'vitest>vite': ^6.0.0 # vitest@4 doesn't work with vite@5, vite@7 doesn't work on node18
6161
vite-beta:
62-
vite: ^8.0.0-beta.9
62+
vite: ^8.0.0-beta.18
6363
'@sveltejs/vite-plugin-svelte': ^7.0.0-next.0
6464
node-18:
6565
vite: ^6.0.0 # vite7 requires node20

0 commit comments

Comments
 (0)