question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run tests with Vite dev server

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
LeBenLeBencommented, Mar 7, 2021

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.

0reactions
bahmutovcommented, Nov 8, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found