Comments (10)
@bcoe Finally got around to testing this. It seems the --all
option is broken for me now.
without it I get the coverage report but when I enable it I get a
~/fantastiq/node_modules/istanbul/lib/object-utils.js:247
for (i = 0; i < retArray.length; i += 1) {
^
TypeError: Cannot read property 'length' of undefined
at ~/fantastiq/node_modules/istanbul/lib/object-utils.js:247:37
at Array.forEach (native)
at Object.mergeFileCoverage (~/fantastiq/node_modules/istanbul/lib/object-utils.js:244:31)
at ~/fantastiq/node_modules/istanbul/lib/collector.js:71:44
at Array.forEach (native)
at Object.Collector.add (~/fantastiq/node_modules/istanbul/lib/collector.js:68:31)
at ~/fantastiq/node_modules/nyc/index.js:213:15
at Array.forEach (native)
at NYC.report (~/fantastiq/node_modules/nyc/index.js:212:23)
at report (~/fantastiq/node_modules/nyc/bin/nyc.js:137:7)
from nyc.
And doing the same with the --all
option gives more different results:
cli tests enabled:
-----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-----------------|----------|----------|----------|----------|----------------|
bin/ | 100 | 100 | 100 | 100 | |
fantastiq.js | 100 | 100 | 100 | 100 | |
lib/ | 29.48 | 10.98 | 8.15 | 29.55 | |
Queue.js | 41.33 | 20 | 12.5 | 41.61 |... 414,418,422 |
QueueClient.js | 51.11 | 0 | 10 | 51.11 |... 50,52,58,59 |
Worker.js | 15.19 | 0 | 0 | 15.19 |... 131,134,139 |
index.js | 56.52 | 100 | 16.67 | 56.52 |... 29,30,31,37 |
jobUtils.js | 30.43 | 7.14 | 25 | 30.43 |... 36,38,39,40 |
message.js | 12 | 0 | 0 | 12 |... 32,33,34,39 |
metrics.js | 41.67 | 25 | 33.33 | 41.67 |... 31,32,33,36 |
router.js | 10.91 | 0 | 0 | 10.91 |... 237,243,245 |
util.js | 16.67 | 100 | 0 | 16.67 | 4,5,6,8,11 |
-----------------|----------|----------|----------|----------|----------------|
All files | 35.71 | 15.85 | 16.22 | 35.78 | |
-----------------|----------|----------|----------|----------|----------------|
cli tests skipped:
-----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-----------------|----------|----------|----------|----------|----------------|
bin/ | 4.26 | 0 | 0 | 4.26 | |
fantastiq.js | 4.26 | 0 | 0 | 4.26 |... 133,134,136 |
lib/ | 4.33 | 0 | 0 | 4.34 | |
Queue.js | 0.67 | 0 | 0 | 0.67 |... 421,422,425 |
QueueClient.js | 6.67 | 0 | 0 | 6.67 |... 72,73,74,76 |
Worker.js | 3.8 | 0 | 0 | 3.8 |... 134,139,142 |
index.js | 13.04 | 0 | 0 | 13.04 |... 34,36,37,40 |
jobUtils.js | 17.39 | 0 | 0 | 17.39 |... 38,39,40,43 |
message.js | 8 | 0 | 0 | 8 |... 33,34,39,44 |
metrics.js | 4.17 | 0 | 0 | 4.17 |... 33,36,40,41 |
router.js | 2.73 | 0 | 0 | 2.73 |... 245,248,249 |
util.js | 16.67 | 100 | 0 | 16.67 | 4,5,6,8,11 |
-----------------|----------|----------|----------|----------|----------------|
All files | 4.32 | 0 | 0 | 4.33 | |
-----------------|----------|----------|----------|----------|----------------|
from nyc.
@Janpot I will need to dig into how the babel step in your test-suite works, I'm guessing this is where something is getting lost in translation.
from nyc.
@Janpot both babel-registry, and nyc override require
:
https://github.com/babel/babel/blob/master/packages/babel-register/src/node.js#L99
I'm starting to dig, and will see if I can get them to play nice together 👍
from nyc.
thanks for looking into this.
from nyc.
@Janpot it might be useful if you'd chime in on this pull request:
I'm trying to convince the maintainers of babel, that it would be great to expose a hook for other libraries to instrument the babel-compiled code.
from nyc.
@Janpot a work in progress (needs more tests and some code cleanup), but give this a shot:
It adds support for babel using:
- a more complicated approach to overriding the require extension.
- fancy source-map shenanigans.
from nyc.
Thanks, looking good.
I'll give it a shot when I work on this again
from nyc.
@Janpot [email protected]
is now out the door with Babel support. I've written this blog post on the topic:
polyglotweekly/polyglotweekly.com#15
from nyc.
@bcoe Thanks, I'm trying it out but running into other babel issues first.
from nyc.
Related Issues (20)
- Maximum call stack size exceeded at /.../[email protected] HOT 1
- [email protected] Vulnerability within [email protected] HOT 5
- Error "JavaScript heap out of memory" in v15.1.0 HOT 2
- Getting error while creating test report using Junit
- Inconsistency in .nyc_output causing nyc annotator crash HOT 1
- nyc mocha is showing unknown(0%) code coverage with typescript module.
- Clears Code Coverage Data and Resets Coverage Context When Child Processes Are Created
- `nyc` + `esm` is broken in latest NodeJS versions HOT 17
- Stuck at extraction
- Jest and Cypress's coverage merged results is wrong
- nyc should use nodejs module customization hooks rather than monkey patching
- Node v20: TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('128SIGINT') HOT 5
- Is there any way to extract/remove Babel from NYC?
- How to use nyc with TypeScript and ESM? HOT 1
- fix: merging two coverage reports for same source file causes crash HOT 1
- NYC checkCoverage doesn't have a way to throw error when insufficient coverage met
- nyc test coverage on branches is not accurate - Seems to be happening with nyc@v15, [email protected] and [email protected] HOT 6
- Code coverage is not instrumenting React components (React Native)
- Code rewriting breaks function name inferencing HOT 1
- nyc not working with project type module (esm) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nyc.