You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some consider having nested describes a bad practice, and prefer splitting tests into several files. See avajs/ava#222 for a discussion for the introduction of nesting in AVA (which is currently not accepted, and probably never will).
I'm proposing this rule for people such as myself that like this train of thought but use Mocha in their projects.
describe('foo',function(){// ...});describe('bar',function(){// or even split it into several files// ...});
Now that I think about it, another way to do this could be to only allow one describe per file, which would make the valid example invalid. This would probably be better as a different but complimentary rule (either allow one describe per file, or one describe per "level").
The text was updated successfully, but these errors were encountered:
Sorry for kind of proposing two rules at the same time and making this confusing.
My initial proposal is to have a rule that forbids having a describe inside of another describe.
And when writing this proposal, I noticed that we could take this "no nesting" (or maybe AVA-ification) one step further and forbid having more than one describe in a single file, which I think should probably be a different rule.
I proposed both at the same time as there is some overlapping (if I have nested describes, both rules would trigger). Maybe the second rule should only warn about sibling describes
Some consider having nested describes a bad practice, and prefer splitting tests into several files. See avajs/ava#222 for a discussion for the introduction of nesting in
AVA
(which is currently not accepted, and probably never will).I'm proposing this rule for people such as myself that like this train of thought but use Mocha in their projects.
Examples
Invalid
Valid
Now that I think about it, another way to do this could be to only allow one
describe
per file, which would make the valid example invalid. This would probably be better as a different but complimentary rule (either allow onedescribe
per file, or onedescribe
per "level").The text was updated successfully, but these errors were encountered: