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-setup-in-describe] Symbol() considered problem #295

Open
GradedJestRisk opened this issue Jul 23, 2021 · 0 comments
Open

[no-setup-in-describe] Symbol() considered problem #295

GradedJestRisk opened this issue Jul 23, 2021 · 0 comments

Comments

@GradedJestRisk
Copy link
Contributor

Summary

I came against rule activation on calls on ECMAScript Symbol class.
I think it should not happen, as it does not affect the global state.

Details

https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-setup-in-describe.md

This rule reports all function calls and use of the dot operator (due to getters and setters) directly in describe blocks.

This code is rejected

const assert = require('assert/strict');
describe('no-setup-in-describe', () => {

  // ESLint: Unexpected function call in describe block.(mocha/no-setup-in-describe)
  const foo = Symbol('bar');

  it('foo should not be null', async () => {
    assert.notStrictEqual(foo, null);
  });

});

Symbol does merely instantiate a non-mutable object.

Configuration:

  • node 16.5
  • eslint 7.27
  • eslint-plugin-mocha 9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant