coverjs loader for webpack
Usage
webpack-dev-server "mocha!./cover-my-client-tests.js" --options webpackOptions.js
module.exports = {
output: "bundle.js",
publicPrefix: "/",
debug: true,
includeFilenames: true,
watch: true,
postLoaders: [{
test: "",
exclude: [
"node_modules.chai",
"node_modules.coverjs-loader",
"node_modules.webpack.buildin"
],
loader: "coverjs-loader"
}]
}
require("./my-client-tests");
after(function() {
require("cover-loader").reportHtml();
});
See the-big-test for an example.
You don't have to combine it with the mocha loader, it's independent. So if you want to cover a normal app usage, you can do so. The reportHtml
function just appends the output to the body.
License
MIT (http://www.opensource.org/licenses/mit-license.php)