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

Forbid duplicate test names #33

Closed
lo1tuma opened this issue Sep 12, 2015 · 2 comments · Fixed by #97
Closed

Forbid duplicate test names #33

lo1tuma opened this issue Sep 12, 2015 · 2 comments · Fixed by #97
Labels

Comments

@lo1tuma
Copy link
Owner

lo1tuma commented Sep 12, 2015

No description provided.

@lo1tuma
Copy link
Owner Author

lo1tuma commented Sep 13, 2015

The following patterns should be considered a warning

it('foo');
it('foo');

We need to decide if we want to only disallow duplicates in the same describe level or in the whole file.
Should we also disallow duplicate describe names?

@jfmengels
Copy link
Collaborator

We need to decide if we want to only disallow duplicates in the same describe level or in the whole file.

In the same describe level.

describe('foo', function() {
  it('should throw when called with null', function() {})
});
describe('bar', function() {
  it('should throw when called with null', function() {})
});

I think it's fine to have the same title here, as the end title would be different for both.

Should we also disallow duplicate describe names?

Yes. Ideally, this should be project wide for top-level describe, but ESLint is not fit to check that.

jfmengels added a commit to jfmengels/eslint-plugin-mocha that referenced this issue Aug 27, 2016
lo1tuma pushed a commit that referenced this issue Aug 27, 2016
* Add `no-identical-title` rule (fixes #33)

* Fix doc errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants