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

jest/no-identical-title doesn't report if using backticks #232

Closed
himynameisdave opened this issue Mar 4, 2019 · 3 comments · Fixed by #237
Closed

jest/no-identical-title doesn't report if using backticks #232

himynameisdave opened this issue Mar 4, 2019 · 3 comments · Fixed by #237

Comments

@himynameisdave
Copy link
Contributor

@himynameisdave himynameisdave commented Mar 4, 2019

Just checked and it appears that jest/no-identical-title doesn't report an error when specifying the title using backticks (even when not using string interpolation).

Error:

describe('an odd case where identical titles are not reported', () => {
    it('this works as expected', () => {
        //  ...test code here
    });
    it('this works as expected', () => {
        //  ...test code here
    });
});

Not reported:

describe('an odd case where identical titles are not reported', () => {
    it(`this does not work as expected`, () => {
        //  ...test code here
    });
    it(`this does not work as expected`, () => {
        //  ...test code here
    });
});
@macklinu
Copy link
Collaborator

@macklinu macklinu commented Mar 10, 2019

Thank you for the report. It looks like we should also be checking that the first argument is a TemplateLiteral without any expressions (e.g. no ${}) in the following area.

if (!isFirstArgLiteral(node)) {
return;
}
const title = node.arguments[0].value;

A PR is welcome - may take a further look at it this weekend, and if so, will comment that I'm picking it up. If you or anyone else would like to submit a PR with a fix, please comment!

@himynameisdave
Copy link
Contributor Author

@himynameisdave himynameisdave commented Mar 10, 2019

@macklinu I'd love to, thanks for pointing me to it!

@SimenB
Copy link
Member

@SimenB SimenB commented Mar 12, 2019

🎉 This issue has been resolved in version 22.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

AndrewLeedham added a commit to xeroxinteractive/eslint-config that referenced this issue Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants