Mocha supports it.only
syntax to reduce the amount of tests to run. In our team, a developer might use it.only
temporally within a code base.
Now it happened that such an only
test was approved and deployed by accident. This led the build server to happily only only run one test and to declare that build a success.
My question now becomes: Is there a way to tell mocha:
It should only allow only
on a developer's machine? Can it be make environment aware so that either all tests always run on a build machine or an only
test case would also declare the job a failure.
(I know that there are different ways to reduce the amount of tests run by mocha. E.g. within WebStorm one can run a subset of tests within a project without changing code. The scope of the question is to allow for the fact that a developer might use it.only
and they shall be free to do so. I want to detect if such a change might sneak its way into the codebase though.)
Aucun commentaire:
Enregistrer un commentaire