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.

Hi coryhouse !

First I would like to thank you for this great starter project.

I recently start to develop with this and when I wanted to generate my test coverage I realized that I’ve got a coverage at 100% while I haven’t done any test.

After some researches, I found that the coverage was only applied on .spec files, so only js files with a spec file defined are registered for the coverage.

So I did this in my package.json :

"test": "mocha tools/testSetup.js \"src/app/**/*.js\" --reporter progress",
"test:cover": "babel-node node_modules/isparta/bin/isparta cover --root src --report html node_modules/mocha/bin/_mocha -- --require ./tools/testSetup.js \"src/app/**/*.js\" --reporter progress"

And now I have a full coverage on all my js files, and a correct percentage value (- which is far from 100% !).

Note : it seems that mocha is unable to load index.js and webpack-public-path.js, so I put my all app in a ‘app’ subfolder.

I hope this can be usefull to somebody 😉

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
silentbobbertcommented, Feb 3, 2017

image

I think @kwelch has now got a test runner that works on Windows with coverage enabled 👍

3reactions
kwelchcommented, Feb 3, 2017

test:cover looks good for me on the new jest branch.

I would appreciate it, if @nibblesnbits could review with Windows 10 and let me know if the move to jest resolves that issue.

I expect it would, but prior to merging the jest branch I would love to have that confirmed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test Coverage in Software Testing - Guru99
Test coverage is defined as a metric in Software Testing that measures the amount of testing performed by a set of test.
Read more >
Test Coverage in Software Testing (Tips to Maximize Testing ...
Test coverage helps monitor the quality of testing, and assists testers to create tests that cover areas that are missing or not validated....
Read more >
Test Coverage Techniques: The Top Ones You Need - Testim.io
Test coverage is the process you use to determine whether you're testing everything you're supposed to test. It allows you to check the ......
Read more >
Code coverage - Wikipedia
In computer science, test coverage is a percentage measure of the degree to which the source code of a program is executed when...
Read more >
Test Coverage in Software Testing - Tutorialspoint
In software testing, test coverage is defined as a statistic that indicates the quantity of testing completed by a collection of tests.
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