Git Product home page Git Product logo

mocha-istanbul's Introduction

mocha-istanbul

Mocha reporter to generate coverage report of istanbul instrumented code.

Usage

  1. Install istanbul, mocha and mocha-istanbul
  2. Instrument your code using istanbul
  3. Make your tests to use the instrumented code (see COA library as an example)
  4. Run mocha using mocha-istanbul as a reporter
  5. Use the environment variable ISTANBUL_REPORTERS to specify a comma separated list of istanbul reports. By default ISTANBUL_REPORTERS=text-summary,html

mocha-istanbul's People

Contributors

arikon avatar hmalphettes avatar searls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mocha-istanbul's Issues

Is it possible to add extra params that are passed to the code executed

Sometimes we need to pass some extra command line params to code executed.
As of now we have:

  • nodeOptions
  • mochaOptions
  • istanbulOptions

none of them helps to achieve this goal.
Correct me if I'm wrong, but there's no possibility to add parameters at the and of args passed for execution. In other words, one cannot achieve something like this:

node_modules/istanbul/lib/cli.js cover --dir <some-dir> /node_modules/mocha/bin/_mocha -- target/test/specs/**/*.spec.js --some-extra-param

If I'm wrong and it's possible I'll be very much obliged if you'll show how it can be done.
If it is not, I suggest to add extraOptions (or whatever it will be named).

I can contribute.

can you create an example

in your README.md file, can you show a solid example of how to do this? What are the benefits of using mocha-istanbul versus plain old istanbul with Node.js?

Coverage summary shows threshold met but then error is thrown for threshold not met

=============================== Coverage summary ===============================
Statements : 92.85% ( 8005/8621 )
Branches : 84.35% ( 3159/3745 )
Functions : 91.15% ( 1925/2112 )
Lines : 92.97% ( 7706/8289 )

THE EXCEPTION BEING THROWN IS ERROR: Coverage for statements (68.9%) does not meet global threshold (75%)
ERROR: Coverage for lines (69.72%) does not meet global threshold (75%)

/Users/btineo/Desktop/myProject/node_modules/istanbul/lib/cli.js:39
throw ex; // turn it into an uncaught exception
^
ERROR: Coverage for statements (68.9%) does not meet global threshold (75%)
ERROR: Coverage for lines (69.72%) does not meet global threshold (75%)
Warning: Use --force to continue.

an example

For example, I don't know what this means:

1...
2. Instrument your code using istanbul
3...

Better documentation

  • A line showing the how to "run mocha using mocha-istanbul as the reporter"
  • Explain where one would define the ISTANBUL_REPORTERS variable

Cut a new release

Just noticed master is ahead of npm, and I really need the ISTANBUL_REPORT_DIR env var. Could you cut a 0.3.0 release please?

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.