Skip to content

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

Open
Nic-Polumeyv wants to merge 5 commits into
version-3from
server-respond-tests
Open

chore: run the basics server tests against Server.respond#16872
Nic-Polumeyv wants to merge 5 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").

80 of the 93 now run under vitest against the built app served in-process with getRequest/setResponse from @sveltejs/kit/node, the adapter-node path. The whole file runs in ~2 s after a build, with pnpm test:unit, no browser or port involved, and failures come back as a plain response diff instead of a Playwright trace. Each test also stops being repeated across the six no-js legs and the async/resolution variants.

13 stay in Playwright: 3 assert dev-server behaviour, 10 need the static-asset and prerendered-page serving that adapters and vite preview do around Server. Anything that only talks to Server can follow the same path with no new plumbing.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 20, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 2c0208d:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2c0208d60571bac7ae29dace6cbaa0456779077b

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: 2c0208d

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.

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