Skip to content

expect.objectContaining support in toHaveStyle #110

Closed
@benmonro

Description

@benmonro
  • eslint-plugin-jest-dom version:
  • node version:
  • npm version:

Relevant code or config

 expect(collapse.style).not.toContain(
    expect.objectContaining({
      display: 'none',
      height: '0px',
    })
  );

What you did:

What happened:


Error:
TypeError: Cannot read property 'replace' of undefined
Occurred while linting <text>:74
    at camelCase (/home/runner/work/eslint-plugin-jest-dom/eslint-plugin-jest-do
m/dist/rules/prefer-to-have-style.js:15:30)
    at Object.fix (/home/runner/work/eslint-plugin-jest-dom/eslint-plugin-jest-d
om/dist/rules/prefer-to-have-style.js:85:160)

Reproduction repository:
https://github.com/testing-library/eslint-plugin-jest-dom/runs/1470632531?check_suite_focus=true

Problem description:

Suggested solution:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions