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

Exit with exitCode = test count when running with --forbid-only flag #286

Open
Lakitna opened this issue Apr 8, 2020 · 0 comments
Open

Comments

@Lakitna
Copy link

Lakitna commented Apr 8, 2020

When running any test suite in a pipeline I always make sure to give the --forbid-only flag. When doing that with this package it exits the process with a non-zero exit code.

In fact, when I have 10 tests, it will fail with exit code 10. When I have 9 it will exit with 9 etc.

Are you using .only internally to make the parallelism work? If you do the implementation of --forbid-only can't be simply passed to Mocha. If not, this is probably a bug.

To make this work as expected we'll probably have to add some logic to https://github.com/mocha-parallel/mocha-parallel-tests/blob/master/src/bin/options/forbid-only.ts.

For now, I'll work around this with a linting rule to make sure no test is set to .only. https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-exclusive-tests.md

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

No branches or pull requests

1 participant