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
Allow custom test functions #81
Allow custom test functions #81
Conversation
This feature is useful if using this plugin with a package like `ember-mocha`, which provides its own set of `describe` functions. A custom array can be provided so that those extensions can also be protected from having `only` called.
5335c20
to
8c28af6
Compare
8c28af6
to
a2cbf40
Compare
Sorry about the messy Coveralls comments, I overwrote my commits a few times. |
Thanks for the Pull Request. It seems like adding those options to each rule introduces a lot of duplication, especially if we add more rules to this plugin in the future. {
"rules": {
"mocha/no-exclusive-tests": "error",
"mocha/no-skipped-tests": "error"
},
"settings": {
"mocha/additionalTestFunctions": [ "describeModule" ],
"mocha/additionalXFunctions": [ "xcustom" ]
}
} or {
"rules": {
"mocha/no-exclusive-tests": "error",
"mocha/no-skipped-tests": "error"
},
"settings": {
"mocha": {
"additionalTestFunctions": [ "describeModule" ],
"additionalXFunctions": [ "xcustom" ]
}
}
} |
Huh, that's really cool. I didn't know you could configure ESLint that way -- I like it much better. Totally agree that the current approach means duplication, I'll fix up this PR to implement with shared settings instead. |
Added the shared config just like @lo1tuma suggested, allowing either the one-line or nested option object. |
Great work @alexlafroscia. Thank you 🍻 . |
This feature is useful if using this plugin with a package like
ember-mocha
, which provides its own set ofdescribe
functions. A custom array can be provided so that those extensions can also be protected from havingonly
called.One thought about my changes is that it introduces a configuration object rather than an array. We could make the option parameter just an array, but I kind of like the extra context provided by the named keys. The difference is basically between this (how I have it right now)
and this (which I think provides less context and it more confusing)
Closes #80