Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

coffee-coverage

benbria3.6kMIT3.0.1

Istanbul and JSCoverage-style instrumentation for CoffeeScript files.

javascript, coffeescript, coverage, code coverage, test, unit test, istanbul, jscoverage, coveralls

readme

semantic-release

Istanbul and JSCoverage-style instrumentation for CoffeeScript files.

Benbria CoffeeCoverage

Build Status Coverage Status Dependency Status devDependency Status

Instruments CoffeeScript files for code coverage. Compiles .coffee files to .js files, and adds JSCoverage or Istanbul style instrumentation for the original coffee script source.

NPM

Features

Quick Start

Assuming you have a folder named "test" full of mocha tests, which directly loads your .coffee files, then from your project's folder, run:


$ npm install --save-dev coffee-coverage
$ npm install --save-dev istanbul
$ mocha --recursive --compilers coffee:coffeescript/register --require coffee-coverage/register-istanbul test

$ ./node_modules/.bin/istanbul report

You should now have an Istanbul coverage report in ./coverage/lcov-report/index.html.

If this doesn't quite do what you're after, check out our tutorials below:

Tutorials:

Have coffee-coverage working in a setup not described above? Raise an issue and let us know how you're using coffee-coverage, so we can document it here.

What it Does

Benbria CoffeeCoverage is a tool for determining the coverage of your unit tests. It does this by instrumenting .coffee files to see how often each line, branch, or function is executed. CoffeeCoverage is capable of producing both Istanbul and JSCoverage style instrumentation.

changelog

coffee-coverage Changelog

v3.0.0

  • This version works with CoffeeScript v2

v2.0.0

  • Add support for nyc.

v1.0.2

v1.0.0

  • #71: Accept globs as excludes Many thanks to dbartholomae for this much requested feature. Note that excludes will still match if they are prefixes (so you can still use /node_modules to eliminate everything in the /node_modules folder), but you can also use globs here.

v0.7.0

v0.5.3

v0.5.2

  • Fix weird corner case if statement.
  • Better streamline support.
  • Add support for caching files between runs.

v0.5.1

  • Fix for istanbul instrumentation for if expressions that are implicit returns and are missing an else.

v0.5.0

  • Added support for Istanbul. (thanks to Carsten Klein for some help and suggestions.)
  • Added support for pragmas.
  • Dropped support for node.js v0.6.x.
  • coffee-coverage/register now instruments all js files in the CWD by default (instead of only files which get loaded.) You can disable this behavior by setting the COFFEECOV_INIT_ALL environment variable to 'false'.

Breaking changes:

  • CoverageInstrumentor.instrumentCoffee() now expects an absolute path for a file. It will probably continue to work, even if you pass a relative path, though.

v0.4.5

  • Compatibility fix for coffee-script 1.9.1 (thanks technogeek00)

v0.4.4

  • Make the behavior of "skip" be consistent between CLI and dynamic compilation.
  • Drop use of Cakefile for builds.

v0.4.3

  • Add coffee-coverage/register for easier mocha testing (thanks devongovett)

v0.4.2

  • Fix exclude bug when dynamically instrumenting files.

v0.4.1

  • Fix async bug when creating new directories (thanks can3p).

v0.4.0

  • Add support for literate CoffeeScript (thanks frozenice-).

v0.3.0

  • Add support for dynamically compiling .coffee and ._coffee files on the fly. (Special thanks to sivad77 for the suggestion.)
  • Experimental support for streamlinejs.

v0.2.0

  • Force coffeescript to disable chaining of if/else if statements during compile. This fix is required for coffee-script 1.6.3 and higher.

v0.1.4

  • Add '--bare' option (thanks effata!)

v0.1.3

  • Update to Coffee-Script >=1.6.2.

v0.1.2

  • Update to Coffee-Script 1.6.1.

v0.1.1

-Ran into a strange bug in Coffee-Script 1.5.0 that's fixed in git, so I switched the dependency to the latest Coffee-Script for now. Basically this:

    done null, _.extend
      myObj: "foo"

doesn't compile the way you would expect it to.

v0.1.0

-Switch over to official Coffee-Script (v.1.5.0 or higher) -Bug fix from vslinko for writing files synchronously.

v0.0.6

-Bug fix from dstokes for recursively creating directories.

v0.0.5

-Fix bug in "abbr" paths when path is absolute (starts with "/").

v0.0.3

-Fix bug which stopped -i option from working.

v0.0.2

  • Added '-i' option to specify an 'init' file.
  • Changed return value of CoverageInstrumentor.instrumentCoffee - now returns an "init" and a "js" which must be concatenated to get fully instrumented source.