antfu-collective / vitesse

🏕 Opinionated Vite + Vue Starter Template
https://vitesse.netlify.app/
MIT License
8.79k stars 932 forks source link

ci: use `vite preview` to start prod build #503

Closed benny123tw closed 1 year ago

benny123tw commented 1 year ago

Description

The e2e tests failed due to Vite optimizing the dependencies in the dev mode. When Vite optimizes the dependencies, the page will reload.

Set the start command tonpx vite preview --port 3333 to start the production build and prevent Vite optimizes the dependencies during testing.

Here are the simulation steps of test markdown:

click on the about link check if URL is equal to /about [vite] ✨ optimized dependencies changed. reloading (page load)--page loaded-- -> localhost:3333/ check timeout -> test fail

Reproduce locally

  1. open cypress
  2. run a spec, then configure the network option to Slow 3G or Fast 3G in the dev tool
  3. run vite --port 3333 --force
  4. restart the test

Linked Issues

none

Additional context

none