chore: run the basics server tests against Server.respond - #16872
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/877bcff3d812590929de85fcb94c593bbac08acdOpen in |
|
|
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? |
|
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. |
2c0208d to
cc5e1b8
Compare
This comment was marked as spam.
This comment was marked as spam.
cc5e1b8 to
7b36829
Compare
7b36829 to
cb12ee2
Compare
f03dc93 to
cd219df
Compare
Co-authored-by: Rich Harris <rich.harris@vercel.com>
…yer where it can run
64761f3 to
877bcff
Compare
f044f62 to
877bcff
Compare
The server tests in
basicsnever 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 ofServer").They now run under vitest from
unit-test/server.spec.js, calling the built app'sServer.responddirectly with no HTTP in between. WithKIT_TEST_DEVset 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 owntest:devandtest:buildafter 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 whatvite previewand the dev server do aroundServer(static assets, prerendered output).Stacked on #17036: three of the moved
HEADtests need it in build mode.