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

Rule jest-dom/prefer-to-have-attribute autofix breaks the code #52

Closed
RIP21 opened this issue Jul 2, 2020 · 7 comments · Fixed by #64 or #65
Closed

Rule jest-dom/prefer-to-have-attribute autofix breaks the code #52

RIP21 opened this issue Jul 2, 2020 · 7 comments · Fixed by #64 or #65
Labels
bug Something isn't working released

Comments

@RIP21
Copy link

RIP21 commented Jul 2, 2020

  • eslint-plugin-jest-dom version: 3.0.1
  • node version: 12.16.1
  • npm version: 6.13.4

Turns this

 expect(link.getAttribute('href')).toContain(`fincrime_analyst=${encodeURIComponent(mockedAnalyst.id)}`)

Into this

expect(link).toHaveAttribute('href', expect.stringContaining(undefined))
@nickserv nickserv added the bug Something isn't working label Jul 2, 2020
@benmonro
Copy link
Member

benmonro commented Jul 3, 2020

Yikes thanks for reporting. Mind opening a pull request?

@RIP21
Copy link
Author

RIP21 commented Jul 6, 2020

@benmonro I wish I have free time for that and familiarity with the codebase and ESLint instruments for AST stuff :) (I'm familiar with Babel mostly)
Anyway, will see, maybe I'll have motivation to do that :)

Any resources you recommend to check out to get up to speed quickly?

@benmonro
Copy link
Member

benmonro commented Jul 6, 2020

@RIP21 i personally like www.astexplorer.net as a playground. In fact I do most of my work in that then move it into vscode from there. Other than that the eslint docs are pretty good too.

@RIP21
Copy link
Author

RIP21 commented Jul 6, 2020

@benmonro sure, it's impossible to work with AST without it (the explorer) :D
Okay, nothing new then. Babel documentation is a little meh and you really need to be stubborn to finally find something good about their AST instruments not just about plugins etc. that's why I'm asking :)

@benmonro
Copy link
Member

benmonro commented Jul 6, 2020

Yeah. What I like about eslint is the query syntax. It's very similar to a css selector but for Dom nodes instead. Anyway if I have time I'll comment on the issue that I'm working on it but it might be a few days as I'm on a family vacation at the moment

@benmonro
Copy link
Member

🎉 This issue has been resolved in version 3.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@benmonro
Copy link
Member

🎉 This issue has been resolved in version 3.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
3 participants