-
Notifications
You must be signed in to change notification settings - Fork 62
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
Rules proposal: one describe per file #103
Comments
Hi @alecxe, thanks for the suggestion. I like the idea and would probably use such a rule as I’m already restrict my test files to only have one top-level describe 😉 . Just for completeness: there are of course some limitations to static analysis in JavaScript where not all top-level describes can be detected. For example when someone creates test suites dynamically: function createTestCases(name) {
describe(name, function () {
// tests ...
});
}
createTestCases('foo');
createTestCases('bar'); |
FYI, this is kind of similar to #83. |
@jfmengels Good hint. I guess this rule together with a |
Ah, good point. Fine by me then 👍 |
The rationale and the use case we have is described here Enforce one describe per file.
To summarize - the rule should produce a warning if there is more than one top-level
describe
per file.Probably, we have too narrow of a use case - feel free to close if you feel there is no need for this kind of rule. Or, may be we can just turn it off by default.
Thanks!
The text was updated successfully, but these errors were encountered: