Open
Description
eslint-plugin-jest-dom
version: 5.5.0node
version: 18.20.3npm
version: 10.2.3
Relevant code or config:
// eslintrc.js
{
// ...
rules: {
'jest-dom/prefer-to-have-style': 'error',
}
}
// component.test.js
expect(node.style.color).toBe('red'); // Works
const red = 'red';
expect(node.style.color).toBe(red); // Doesn't work
What happened:
I'm referencing a variable in the toX()
methods, but the rule doesn't report.
I would've expected it to report. Is it intentional? Didn't find other issues mentioning this, but the selectors in the code don't seem to handle it.
Reproduction repository:
Metadata
Metadata
Assignees
Labels
No labels