Repository navigation
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/1c86eaee36abbf151ddecfad2d3e7cf6c736dad1Open in |
There was a problem hiding this comment.
Vitest expects vitest.*.config.js filenames otherwise the extension throws
elliott-with-the-longest-name-on-github
left a comment
There was a problem hiding this comment.
thanks my guy
|
Noticed this is draft but it looks done? |
|
Yeah there are a few vitest run scripts that still need to be fixed. It’s running all the unit tests rather just the ones in the directory |
|
intergration tests
The `CSPs in prod` block in `csp.spec.js` and the `cookies in prod` block in `cookie.spec.js` don't run in any project. They are skipped when `process.env.DEV` is set, and Vitest sets `process.env.DEV` to `'1'` itself (it mirrors `import.meta.env`), so they are skipped in `kit-server-dev` as well as in `kit-server-build`, which sets `DEV: 'true'`. The dev blocks run twice instead. This dates from #16555, which replaced the `NODE_ENV=production` run of these two files with the `kit-server-build` project. This sets `DEV` to an empty string in `kit-server-build`, the project that only includes these two files, so it runs their production blocks, and `kit-server-dev` keeps running the dev blocks. Before, on `main`: 55 tests skipped in both projects (22 `CSPs in prod`, 33 `cookies in prod`). After: `kit-server-build` runs those 55 and skips the 8 dev ones, `kit-server-dev` the reverse. All pass: `vitest run -c vitest.kit.config.js src/runtime/server/page/csp.spec.js src/runtime/server/cookie.spec.js` gives 72 passed, 64 skipped. On this commit, `pnpm format` (as `oxfmt --check .`), `pnpm lint`, the root `pnpm check` (which generates the types and checks every package and test app) and `pnpm -F @sveltejs/kit test:unit` pass (77 files, 1119 passed, 64 skipped). I didn't run the integration suites; this only changes the unit test config. --- ### 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 - [x] 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 - [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed. --------- Co-authored-by: Tee Ming Chew <chewteeming01@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The
test-kitCI jobs take more than 17 minutes each because it's several consecutive groups of tests. If one test fails, everything needs to be retried and that's another 17 minutes. Separating them into unit, dev, and build, might make it a little faster since they run in parallel and it also makes test retries less painful. This may take up more CI minutes but definitely less wall clock time.This PR also tightens the Vitest workspace config so that it works with both the VS Code Vitest extension and the built-in one for Zed.
EDIT: it takes 10 minutes to complete everything now