Skip to content

chore: run the basics server tests against Server.respond - #16872

Merged
Rich-Harris merged 4 commits into
version-3from
server-respond-tests
Sep 8, 2026
Merged

chore: run the basics server tests against Server.respond#16872
Rich-Harris merged 4 commits into
version-3from
server-respond-tests

Conversation

@Nic-Polumeyv

@Nic-Polumeyv Nic-Polumeyv commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

The server tests in basics never needed a browser: they assert on status, headers and body. Running them through Playwright with JavaScript off meant a preview server and a browser per project, repeated in every no-js leg of the matrix, and a 1 to 2 minute loop to run one of them locally. The file said so itself (server.test.js:33, "this would ideally be a unit test of Server").

They now run under vitest from unit-test/server.spec.js, calling the built app's Server.respond directly with no HTTP in between. With KIT_TEST_DEV set the same file goes through Vite's dev server in middleware mode instead, so both modes keep their coverage. The suite runs from the app's own test:dev and test:build after Playwright, against the build Playwright already made, so nothing builds twice and the unit job is untouched. 13 tests stay in Playwright because they assert what vite preview and the dev server do around Server (static assets, prerendered output).

Stacked on #17036: three of the moved HEAD tests need it in build mode.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 20, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 877bcff:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/877bcff3d812590929de85fcb94c593bbac08acd

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16872

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 877bcff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot

Copy link
Copy Markdown

@Rich-Harris

Copy link
Copy Markdown
Member

Noodling on some tweaks in #16879. One thing neither PR covers AFAICT: the existing setup tests the dev server as well as the prod build, but this only tests the latter IIUC?

@Nic-Polumeyv

Nic-Polumeyv commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Dev is back on 535985a, a second vitest project runs the same spec through Vite in middleware mode. 79 build / 67 dev, 12 skipped where Playwright skipped them too.

@coderabbitai

This comment was marked as spam.

coderabbitai[bot]

This comment was marked as spam.

@Nic-Polumeyv
Nic-Polumeyv changed the base branch from version-3 to head-no-body September 4, 2026 16:47
coderabbitai[bot]

This comment was marked as spam.

Base automatically changed from head-no-body to version-3 September 7, 2026 05:35
@teemingc
teemingc force-pushed the server-respond-tests branch from f03dc93 to cd219df Compare September 7, 2026 05:35
@Rich-Harris
Rich-Harris merged commit 8dc8e5d into version-3 Sep 8, 2026
69 of 73 checks passed
@Rich-Harris
Rich-Harris deleted the server-respond-tests branch September 8, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants