Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
jest-dom eslint rule violation not breaking test

I'm using Reactjs with CRA. I have a test like this;

enter image description here

I'm deliberately forcing jest-dom to produce this prefer-to-have-text-content warning. My test still runs OK and the result is success. Now, I want my test to fail. My .eslintrc file is like;

{
  "plugins": ["testing-library", "jest-dom"],

  "extends": [
    "react-app",
    "react-app/jest",
    "plugin:testing-library/react",
    "plugin:jest-dom/recommended"
  ],
  "rules": {
    "jest-dom/prefer-to-have-text-content": "error"
  }
}

However, my test still succeds! How can I make my test fail in case of such jest-dom issues?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!