Support `max-describe-nesting-level` rule.
See original GitHub issueCurrently we don’t have any rule that could control level of describe
’s nesting.
rules: {
"jest/max-describe-nesting-level": ["warn", {limit: 1}]
},
Good
describe('getSomething', function () {
it('should get green plastic chair with `green` argument', () => {
expect(getSomething('green').toBe('Green plastic chair'))
});
});
Bad
describe('getSomething', function () {
describe('w/o arguments', function () {
it('should get orange jacket', () => {
expect(getSomething().toBe('Orange jacket'))
});
})
});
I can implement this (with better examples 👀) if you are good with this rule?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@G-Rath Thanks for this!
I’ll work on your branch and can open a PR into it unless you merge it before.
Anyway this change shouldn’t affect a lot of files across project and just add new one, so rebasing wouldn’t be a problem here.
Go for it!
I’m actually literally right in the middle of making a big PR for the final round of TS conversations, which includes a new set of Typescript guards & whatnot, so I’d advise branching off that branch when doing the implementation.
I don’t expect that to have a big impact on your PR, and more than happy to help you rebase if needed - it’s just mainly that there’s a lot of JS -> TS renames, so it might make your fork & local git sad 😬
It’s going to be a busy week for me as I can finally do a lot of the small cleaning & refactoring that I’ve had to put off to land my PR 😂
Hopefully I’ve not scared you off - I’m actually excited for this rule, b/c it’ll hopefully mean breaking out the “find test case” logic used in a few of the rules into some nice & small utility functions 😄