question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate .js file in coverage report

See original GitHub issue

Issue

I’m seeing duplicate files in my coverage report, e.g: for every actions.ts there’s a actions.ts.js in the coverage table that actually doesn’t exist on the file system.

If I click on it in the HTML report, I get Unable to lookup source: <file>.

Here’s the relevant part from my jest config:

    "collectCoverage": true,
    "coverageDirectory": "<rootDir>/build/tests/coverage-jest",
    "collectCoverageFrom": [
        "src/**/*.{ts,tsx}",
        "!**/*.{spec,test}.{ts,tsx}",
        "!**/tests/**"
    ],
    "coveragePathIgnorePatterns": [
        "node_modules",
        "\\.(js)$"
    ]

I’m specifically including .ts(x) files and ignoring .js files, so not sure why they still get included.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kulshekharcommented, May 10, 2017

@ssynix starting with version 20.0.0, coverage is no longer handled by ts-jest but by jest directly.

we need at least a minimal repo that reproduces this to move forward.

0reactions
GeeWeecommented, Jun 6, 2017

Excellent! You’re welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate Entries in code coverage report - Stack Overflow
I've added few JS test files and added below mentioned references. In some files I've added smaller case letters in some JS files...
Read more >
No code coverage on .js files - SonarQube - Sonar Community
Trying to scan a ColdFusion application with a few JavaScript files. It looks like (from the screen output) that the .JS files were...
Read more >
Sonar JavaScript Duplicates Detection
I have recently installed Sonar with the JavaScript Plugin, and have let the sonar-scanner analyze some sample projects. I started investigating the ...
Read more >
React Testing using Jest along with code coverage report
js file, you can see that we have duplicate code of const wrapper = shallow(<TodoList />); It's repeated in the first and second...
Read more >
Configuring Test Coverage - Code Climate
Configure your CI to temporarily store the reports from each separate test suite. We recommend syncing and fetching files from S3 as one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found