quick-coverage v1.0.6
Quick-coverage
A small library to run code coverage reports only on the files you modified since the last commit. This package will run all your tests but only instrument the modified files for code coverage, resulting in much faster code coverage reports.
Installation
npm install quick-coverage --save-dev
Requirements
- You should use Mocha in your project to run tests.
- You should use Git as a source control.
Usage
Use this command as the command to run your tests and code coverage:
$> ./node_modules/mocha/bin/mocha ./node_modules/quick-coverage/index.js --recursive ./test/
Or add this to your Makefile:
quick-coverage:
$(ENV_VARS) ./node_modules/mocha/bin/mocha ./node_modules/quick-coverage/index.js --recursive ./test/
Quick-coverage is compatible with the --watch
flag from Mocha. So, in your Makefile, you can use:
quick-coverage:
$(ENV_VARS) ./node_modules/mocha/bin/mocha ./node_modules/quick-coverage/index.js --recursive ./test/
However, while in --watch
mode, quick-coverage
will not generate lcov
reports, only text
and summary
reports.
Tests
Not implemented yet
Acknowledgement
This library was largely inspired by test-creep
.
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Release History
- 1.0.6 Only download execSync if node version is older 0.12 to prevent package build fail
- 1.0.5 Enable compatibility with Mocha's
--watch
mode - 1.0.4 Revert to execSync to comply with MIT license and use native calls for newer node.js versions
- 1.0.3 Switch to sync-exec to maintain compatibility with newer node.js versions
- 1.0.2 Update README
- 1.0.1 Update README
- 1.0.0 Initial release