Skip to content

Conversation

@bcoe
Copy link

@bcoe bcoe commented May 25, 2015

This pull request adds coverage reporting using nyc:

  • run npm run coverage to get a human readable coverage report.
  • run npm run coverage -- --reporter=lcov to get an HTML report over coverage in the /coverage folder.
passed 636 tests in 5.99 seconds 
-----------------------|-----------|-----------|-----------|-----------|
File                   |   % Stmts |% Branches |   % Funcs |   % Lines |
-----------------------|-----------|-----------|-----------|-----------|
   bin/                |       100 |       100 |       100 |       100 |
      cake             |       100 |       100 |       100 |       100 |
      coffee           |       100 |       100 |       100 |       100 |
   lib/coffee-script/  |     89.38 |     85.81 |     86.02 |     89.75 |
      cake.js          |     62.69 |     22.22 |     66.67 |     62.69 |
      coffee-script.js |     90.73 |     77.24 |     80.77 |     92.59 |
      command.js       |     30.26 |     22.35 |      12.5 |     30.49 |
      helpers.js       |     87.34 |     74.12 |        92 |     87.34 |
      index.js         |       100 |       100 |       100 |       100 |
      lexer.js         |     97.26 |     95.42 |     97.73 |     97.73 |
      nodes.js         |     97.32 |     93.04 |     97.83 |     97.44 |
      optparse.js      |      80.9 |     78.57 |      87.5 |      80.9 |
      parser.js        |     90.82 |     89.46 |     64.29 |     90.98 |
      register.js      |     95.45 |     57.14 |       100 |     95.45 |
      repl.js          |     89.06 |     69.39 |     82.35 |     89.06 |
      rewriter.js      |     96.71 |     91.72 |     97.87 |     97.58 |
      scope.js         |     94.68 |     85.71 |     94.12 |      97.8 |
      sourcemap.js     |     92.93 |     81.82 |     92.31 |     92.93 |
-----------------------|-----------|-----------|-----------|-----------|
All files              |      89.4 |     85.81 |     86.02 |     89.77 |
-----------------------|-----------|-----------|-----------|-----------|

@michaelficarra
Copy link
Collaborator

Cool! 👍

@ryoqun
Copy link

ryoqun commented Dec 15, 2016

@bcoe maybe related to my pull request. :) #4348

@GeoffreyBooth
Copy link
Collaborator

I think it’s much more useful to see the coverage of the lines of CoffeeScript code, rather than of the JavaScript compiled output (#4348). Unfortunately there doesn’t seem to be a quick solution to achieve that at the moment, but I’d rather not merge this in just because it’s the only currently available option.

For anyone interested in reports like the example above, you can see nyc-produced test coverage reports without needing this PR or any code changes:

npm install -g nyc
nyc npm test && nyc report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants