Unable to run tests with Vite dev server
See original GitHub issueI have a Vite dev server running on port 3000 with a functioning application. Running the e2e tests in a separate thread works fine. But together run by start-server-and-test
it stucks after starting the Vite server.
- version 1.11.7
- platform MacOS
- expected behavior: Runs the tests after the dev server started.
- actual behavior: start-server-and-test hangs when Vite start the webserver. The server is up and running and the tests can be run in a separate terminal.
My package json setup:
"scripts": {
"start": "vite",
"test:e2e:javascript": "start-server-and-test start http://localhost:3000 e2e:javascript",
"e2e:javascript": "jest --config=jest.e2e.config.js e2e/javascript"
}
Reproduction: In my https://github.com/blacksonic/vue-3-playground repository run: npm run test:e2e:javascript
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Troubleshooting - Vite
Vite cannot handle and does not support code that only runs on non-strict mode (sloppy mode). This is because Vite uses ESM and...
Read more >Laravel Breeze Vite Dev-Server Error: "cannot test case ...
When I run: npm run dev. I get this Error: failed to load config from PATH/vite.config.js error when starting dev server: Error: cannot...
Read more >Add testing to Vite - DEV Community
One piece is left to create the script command in package.json to run the tests. We use the start-server-and-test package with three command- ......
Read more >start-server-and-test - npm
Starts server, waits for URL, then runs test command; when the tests end, shuts down server. Latest version: 1.15.2, last published: 21 days ......
Read more >Asset Bundling (Vite) - The PHP Framework For Web Artisans
If your local development web server is serving your application via HTTPS, you may run into issues connecting to the Vite development server....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is it correct that this still needs to use
http-get
to work? It doesn’t seem to work otherwise for me using Vite 2.0.5 and start-server-and-test 1.12.0.I would gladly add a mention in addition to webpack-dev-server in the README if that’s the case.
Well if this is so simple then it looks to be the Vue / Vite problem, no? They serve pages before they are ready I guess.