Statements detected are not the same in unit-tests context
See original GitHub issueHi,
Currently, I use babel-plugin-istanbul to get code coverage after my E2E tests (selenium). The global variable in my browser window.__coverage__
is correctly filled but for a lot of files, the statements detected are not the same when I execute my unit-tests.
For example, when I generate lcov report for my unit-tests (from nyc mocha), each “import” lines are seen as statement but in my browser in window.__coverage__
variable, these lines are not seen as statement.
Consequently, when I try to merge lcov files generated by my unit-tests and by my E2E tests I have a crash (see below)…
C:\Users\me\AppData\Roaming\npm\node_modules\istanbul\lib\object-utils.js:247 for (i = 0; i < retArray.length; i += 1) { ^ TypeError: Cannot read property 'length' of undefined
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
@bcoe Hi. You can find my fork here : https://github.com/gigaga/babel-plugin-istanbul-issue In this fork, there are 2 ways to compute code coverage from my unit-tests:
The coverages are generated into “results\coverage” folder. You can see that the statements detected are not the same. For example, for nyc, the first line of reducer.jsx is seen as statement where as this same line for babel-plugin-istanbul is not a statement.
I thinks that the merge process is not the problem. My problem is why some statements are not detected by babel-plugin-istanbul whereas these same statements are detected with nyc / mocha (without the plugin)? If statements are the same, there will be no merge problem.