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

Warn about Test FW's '.only' calls #313

Closed
taromero opened this issue Oct 30, 2015 · 2 comments

Comments

@taromero
Copy link

commented Oct 30, 2015

Just hit a case where I merged a test case forgetting to remove Mocha's .only from one of the suites, resulting in CI nor running all of the tests before merging.

The rule would look for either describe.only, context.only or it.only.

It would be nice to detect this. Let me know if it doesn't make much sense.

It seems like there's not an option on raw eslint, but there's a plugin for this: https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-exclusive-tests.md.

@feross

This comment has been minimized.

Copy link
Member

commented Oct 30, 2015

Thanks for opening this issue. I see why you would want to catch stray .onlys in your mocha tests.

I'm not in favor of adding mocha-specific rules to standard. This issue has come in the past when users asked to define describe, it, etc. as globals. The reason is that lots of people use other test frameworks and we don't want to make assumptions about what tools they're using, or tie standard to mocha in an unhealthy way.

There's already a project mocha-standard that might be open to the idea of extending standard and adding mocha-specific rules. Maybe you can try opening an issue there?

@feross feross closed this Oct 30, 2015

@taromero

This comment has been minimized.

Copy link
Author

commented Oct 30, 2015

I understand completely, thanks for the quick reply and for pointing to those resources!

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.