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

False positive when test is not a mocha global #327

Open
perrin4869 opened this issue May 18, 2022 · 1 comment
Open

False positive when test is not a mocha global #327

perrin4869 opened this issue May 18, 2022 · 1 comment
Labels

Comments

@perrin4869
Copy link

Let's say the test file is something like:

import { test } from 'ramda';

const validate = test(new RegExp(...), "foo"); // mocha/no-global-tests,mocha/no-pending-tests

describe(..., () => {
  it(..., () => {
    test(new RegExp(...), "foo"); // mocha/no-nested-tests
  });
});

The above will be false positives because test here is not a mocha global

@lo1tuma
Copy link
Owner

lo1tuma commented May 27, 2022

Hello @perrin4869, thanks for raising this issue. This is indeed a problem, in several rules of this plugin. I have already an idea how to fix it and started a while ago with a proof-of-concept implementation, unfortunately I wasn’t able to find enough time to finish it. The change is quite big, and changes basically all rules and how they work, which could also have a lot of impact on the performance of this plugin (I don’t know yet if the impact is negative or positive though). I hope to get the PoC in a shape where I can push it soon.

Related: #296

@lo1tuma lo1tuma added the bug label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants