Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start server once and run two tests with different runner #304

Closed
mike-4040 opened this issue May 21, 2021 · 2 comments
Closed

start server once and run two tests with different runner #304

mike-4040 opened this issue May 21, 2021 · 2 comments
Labels

Comments

@mike-4040
Copy link

mike-4040 commented May 21, 2021

Not sure if this a FR or just documentation.
We have some functional tests in mocha, some in jest, and I have to start the test server twice.

Can't figure out how I can start the server once and run two tests with different runners.

@bahmutov
Copy link
Owner

If you want to start the server, wait for it to respond, and then run multiple test commands (and stop the server after they finish), you should be able to use && to separate the test commands:

{
  "scripts": {
    "start": "npm start",
    "test:unit": "mocha test.js",
    "test:e2e": "mocha e2e.js",
    "ci": "start-test 9000 'npm run test:unit && npm run test:e2e'"
  }
}

The above script ci after the localhost:9000 responds executes the npm run test:unit command. Then when it finishes it runs npm run test:e2e. If the first or second command fails, the ci script fails. Of course, your mileage on Windows might vary.

@github-actions
Copy link

github-actions bot commented Jun 4, 2021

🎉 This issue has been resolved in version 1.12.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants