-
Notifications
You must be signed in to change notification settings - Fork 199
mocha-no-side-effect-code reported when including/excluding tests #389
Comments
You can configure a rule: "mocha-no-side-effect-code": [true, {"ignore": "it\.skip.*"}] |
I am not sure that it should be the default. A deactivated test does not mean its code does not have to pass the linter rules imho... I see only one good reason for using it.skip : when the feature you test is not yet implemented. Sometimes (unfortunately) you also deactivate a broken test because you plan to fix the tested code or the test code later... |
@loicraux I'm not sure I'm understanding what you are trying to say. What I understood from @NiKlimenko's comment is that it might be possible to come to the same behavior by using the suggested configuration. This might or might not hold true, but that configuration might have other side effects, is that what you are trying to say when writing about "not having to pass linter rules"? Why I filed this issue was that I'm under the impression that using |
Here is the test that I made pass:
|
🎉 thx for fixing this |
@karfau thanks for taking the time to report it and then being patient for the last few months! It has been a crazy winter and we're un-burying ourselves now. |
The
mocha-no-side-effect-code
is also triggered when using one of the following feature of mocha:http://mochajs.org/#inclusive-tests
e.g.
it.skip(...
ordescribe.skip(...
I think this should not happen.
(Update: I removed reference to exclusive tests aka
it.only(...
, because in that the rulemocha-avoid-only
marks the failure, which makes sense in my understanding.)The text was updated successfully, but these errors were encountered: