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

206
Views
How to disable "branchesTrue" property in jest coverage-summary.json

I am trying to generate a coverage-summary.json file using jest but I noticed something new with it...

total now shows a fifth property called branchesTrue. This didn't happen before and I can't pinpoint what version of jest it started writing this property when generating the report.

Looking into the node module called istanbul-lib-coverage and under the file file-coverage.js on line 304 I can see a comment saying that the branch truthiness can be optionally enabled... I suppose it could also mean that this should have been disabled by default or be optionally disabled.

It is not much of a huge problem but I just wanted to know how I can not show this when generating the coverage report without deleting it manually or commenting out this particular line of code in the node_modules directory.

I take this to be fairly new as well since the a comment under node_modules/istanbul-lib-coverage/lib/coverage-summary.js on line 40 says that it should only be four properties:

"CoverageSummary provides a summary of code coverage . It exposes 4 properties, lines, statements, branches, and functions. Each of these properties is an object that has 4 keys total, covered, skipped and pct. pct is a percentage number (0-100)."

before:

"total": {
    "lines": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "statements": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "functions": { "total": 1, "covered": 1, "skipped": 0, "pct": 100 },
    "branches": { "total": 0, "covered": 0, "skipped": 0, "pct": 100 }
  }

now:

"total": {
    "lines": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "statements": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "functions": { "total": 1, "covered": 1, "skipped": 0, "pct": 100 },
    "branches": { "total": 0, "covered": 0, "skipped": 0, "pct": 100 },
    "branchesTrue": { "total": 0, "covered": 0, "skipped": 0, "pct": "Unknown" }
  }

Any help is much appreciated...

about 4 years ago · Santiago Gelvez
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!