question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `max-describe-nesting-level` rule.

See original GitHub issue

Currently 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yavorskycommented, Aug 4, 2019

@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.

1reaction
G-Rathcommented, Aug 4, 2019

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 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found