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.

My console coverage stats are gone when I use jest-runner-groups

See original GitHub issue

Hey, thanks for making this great package! I just tried it out and it works great — but my console coverage stats are not working correctly when I use jest-runner-groups.

Here’s my output when before using the “groups” runner:

$ npm run test
[...]
-----------------|---------|----------|---------|---------|-------------------
File             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------|---------|----------|---------|---------|-------------------
All files        |   97.37 |     61.9 |     100 |   97.14 |
 src             |     100 |       50 |     100 |     100 |
  db.ts          |     100 |       50 |     100 |     100 | 13,14,26,27
 src/entity      |     100 |      100 |     100 |     100 |
  Recording.ts   |     100 |      100 |     100 |     100 |
  Session.ts     |     100 |      100 |     100 |     100 |
  TimeOfDay.ts   |     100 |      100 |     100 |     100 |
 src/radiotools  |   93.94 |    69.23 |     100 |   93.94 |
  radiostatus.ts |   93.94 |    69.23 |     100 |   93.94 | 47,48
-----------------|---------|----------|---------|---------|-------------------

After I add runner: "groups", to my jest.config, the output is like this:

$npm run test
[...]
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |
----------|---------|----------|---------|---------|-------------------

I love the group runner, but I don’t want to loose my instant feedback on coverage.

This is my jest config.

module.exports = {
  preset: 'ts-jest',
  testEnvironment: 'node',
 // runner: "groups",
  roots: [
    '<rootDir>/src'
  ],
  testMatch: [
    '**/__tests__/**/*.+(ts|tsx|js)',
    '**/?(*.)+(spec|test).+(ts|tsx|js)'
  ],
  transform: {
    '^.+\\.(ts|tsx)$': 'ts-jest'
  },
  collectCoverage: true,
 // coverageReporters: ['html'],
  globals: {
    'ts-jest': {
      tsConfig: {
        importHelpers: true,
        downlevelIteration: true,
        esModuleInterop: true,
      }
    }
  }
};

and this the relevant part from the package.json:

 "test": "npx jest --coverage --passWithNoTests",
 "unit": "npx jest --coverage --passWithNoTests --group=unit",
 "integration": "npx jest --coverage --passWithNoTests --group=integration",

Is this by design, or can I set it up in a different way to keep my stats visible? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jwmcconnellcommented, Feb 14, 2020

Hey, wanted to let you know we upgraded our jest to version 25.1.0 so everything is working with 1.1.1 of your package on our end.

1reaction
eugene-manuilovcommented, Feb 13, 2020

Ok, I have just published a new version 1.1.1 which contains the latest jest dependencies. The code coverage should work properly now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Awesome Jest Tip: Coverage Report | by Steve Cruz - Medium
If we click in appointments/services we will see more in depth information showing coverage statistics on each service related to Appointments.
Read more >
Code coverage testing - Visual Studio (Windows)
Analyze code coverage from the command line. To run tests from the command line, use vstest.console.exe utility. Code coverage is an option of ......
Read more >
Coverage Analysis from the Command Line | dotCover ...
On your CI/CD server, add build steps that use the console runner. ... To do so, type dotCover help cover coverage.xml in the...
Read more >
Coverage.py — Coverage.py 7.0.1 documentation - Read the ...
Coverage.py is a tool for measuring code coverage of Python programs. ... Coverage measurement is typically used to gauge the effectiveness of tests....
Read more >
Output rails coverage to console with rake - Stack Overflow
You can play with the data returned by rake stats . And here's the implementation if you want to do it yourself ...
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