You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on an app, built with vite, and wish to run a subset of end-to-end Cypress tests on the optimized build. To generate the UI under test, I run vite build followed by vite preview via the start-server-and-test npm package. The issue is that when a test run finishes and the preview server process is ended, it unconditionally ends with an error code, which causes the test run as a whole to be considered failing regardless of the test results. In contrast, running tests against a dev server started with the vite command exhibits the desired behavior: the signal is explicitly caught and the server process is shut down cleanly. Happy to provide a minimal reproduction if that would be useful.
Suggested solution
An interrupt handler like the one in src/node/server/index.ts:
Experiencing the same issues using playwright tests, causing the process to exit with code 1 and failing the test run.
This fix would be much appreciated. Thanks!
Description
This is closely related to a now-closed past issue and its fix.
I'm working on an app, built with vite, and wish to run a subset of end-to-end Cypress tests on the optimized build. To generate the UI under test, I run
vite build
followed byvite preview
via thestart-server-and-test
npm package. The issue is that when a test run finishes and the preview server process is ended, it unconditionally ends with an error code, which causes the test run as a whole to be considered failing regardless of the test results. In contrast, running tests against a dev server started with thevite
command exhibits the desired behavior: the signal is explicitly caught and the server process is shut down cleanly. Happy to provide a minimal reproduction if that would be useful.Suggested solution
An interrupt handler like the one in
src/node/server/index.ts
:should be placed in
src/node/preview.ts
. Perhaps in thehttpServerStart
function?Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: