Giter Club home page Giter Club logo

Comments (10)

Janpot avatar Janpot commented on June 1, 2024 4

@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.

Janpot avatar Janpot commented on June 1, 2024

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.

bcoe avatar bcoe commented on June 1, 2024

@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.

bcoe avatar bcoe commented on June 1, 2024

@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.

Janpot avatar Janpot commented on June 1, 2024

thanks for looking into this.

from nyc.

bcoe avatar bcoe commented on June 1, 2024

@Janpot it might be useful if you'd chime in on this pull request:

babel/babel#3062

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.

bcoe avatar bcoe commented on June 1, 2024

@Janpot a work in progress (needs more tests and some code cleanup), but give this a shot:

334e479

screen shot 2015-11-24 at 11 37 17 pm

It adds support for babel using:

  • a more complicated approach to overriding the require extension.
  • fancy source-map shenanigans.

from nyc.

Janpot avatar Janpot commented on June 1, 2024

Thanks, looking good.

I'll give it a shot when I work on this again

from nyc.

bcoe avatar bcoe commented on June 1, 2024

@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.

Janpot avatar Janpot commented on June 1, 2024

@bcoe Thanks, I'm trying it out but running into other babel issues first.

from nyc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.