Skip to content
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

no-standalone-expect: False positive when there are multiple describe blocks #291

Open
michaelfaith opened this issue May 7, 2024 · 2 comments
Labels
bug Something isn't working need more info This issue is missing details or reproduction steps

Comments

@michaelfaith
Copy link

michaelfaith commented May 7, 2024

If using nested describe blocks to organize multiple sets of tests, the expect calls within the it tests in the describe blocks after the first, are causing no-standalone-expect to flag them incorrectly.

describe('base', () => {
  it('top level test', async () => {
    expect... // << this one doesn't flag
  });

  describe('nested', () => {
    it('nested test', async () => {
      expect... // << this one flags no-standalone-expect (false positive)
    });
  });
});

Note: if the test function is test instead of it, then it also doesn't flag. It only seems to impact tests that use it

@mskelton
Copy link
Member

mskelton commented May 7, 2024

Interesting, sounds like an issue with the aliases not applying in all instances for some reason.

@mskelton mskelton added the bug Something isn't working label May 7, 2024
@mskelton
Copy link
Member

mskelton commented Jun 9, 2024

@michaelfaith I was unable to reproduce this. Could you create a reproduction code sandbox?

@mskelton mskelton added the need more info This issue is missing details or reproduction steps label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info This issue is missing details or reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants