-
Notifications
You must be signed in to change notification settings - Fork 243
Description
The Problem
Given the following code (simplified version of the use-case):
it('data.foo should contain bar and baz', () => {
const data = {
foo: 'bar_baz',
};
const test = {
content: key => data[key],
};
expect(test.content('foo')).to.contain('bar');
expect(test.content('foo')).to.contain('baz');
});We get the following error:
11:10 error Test title is used multiple times in the same describe block jest/no-identical-title
Why it Happened?
As part of #316 & #317 we now treat test.<anything>() as a test case. While only (test|it).skip, (test|it).only & (test|it).todo are Jest valid options.
In a project that works with its and describes it's possible that a user will choose the name test for a utility object.
(Sadly our case 🙈 )
While in our project we can change those object names, it will create a better developer experience if eslint-plugin-jest will avoid raising false-positive errors in this case.
Proposed Solution
In the following context https://github.com/jest-community/eslint-plugin-jest/pull/317/files#diff-fecc1b14fa96780438948ea994aa4b29R123
Verify that the node.callee.property.name is one of the following: skip|only|todo.