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.

Describe how to run server and tests and shutdown

See original GitHub issue

Often see this question

Hi, what is the recommended say to start your normal dev server before cypress run? 
I tried an NPM script as "test": "yarn start; yarn cypress run" but running into 
background-process issues and the server isn't closed afterwards.

Need to show two ways we do it: via run-p --race server test using npm-run-all and using https://github.com/bahmutov/start-server-and-test

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

60reactions
rwieruchcommented, Mar 22, 2018

Not sure about the status quo of best practice here, but I used start-server-and-test from the CI documentation for my local testing as well. Just wanted to leave the comment here, because when I searched for this topic, I came across this issue 😃

  "scripts": {
    "start": "webpack-dev-server --config ./webpack.config.js --mode development",
    "test:cypress": "start-server-and-test start http://localhost:8080 cypress",
    "cypress": "cypress run"
  },
9reactions
brian-manncommented, Jan 3, 2018

We explain exactly that in the CI document.

https://docs.cypress.io/guides/guides/continuous-integration.html#Booting-Your-Server

And also in the Best Practices.

https://docs.cypress.io/guides/references/best-practices.html#Web-Servers

Maybe should also go in the Usage FAQ.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server Testing Overview | Microsoft Learn
Several kinds of stress tests get run against a server, including basic system functionality, system stress and shutdown/restart tests.
Read more >
E2E Testing: Run, Test and Shutdown the HTTP Server
Hi guys, I am very beginner with CircleCI and have a problem I stuck with. My task is: Run lints, unit tests, builds,...
Read more >
Using start-server-and-test to start app, run tests ... - YouTube
I will use https://github.com/bahmutov/ start - server-and-test to run ... When the tests are done, the start - server-and-test shuts down the ...
Read more >
start-server-and-test - npm
Start using start-server-and-test in your project by running `npm i ... then runs test command; when the tests end, shuts down server.
Read more >
Administering Server Startup and Shutdown for Oracle ...
a software project, from development through test and production phases. ... Starting and Stopping Servers describes several ways to start and stop 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 Reddit Thread

No results found

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