karma-remap-coverage
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "karma-remap-coverage", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Karma reporter that shows coverage for original non transpiled code (TypeScript, ES6/7, etc)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,2 +7,3 @@ # karma-remap-coverage | ||
Needs no temporary files nor npm post run scripts, works in "watch" mode generating report on every change. | ||
![Example](img/coverage_cmp.png) | ||
@@ -16,3 +17,3 @@ | ||
##Configuration | ||
1. Enable inline source maps in your transpiler/compiler | ||
1. Enable inline source maps in your transpiler/compiler config | ||
2. Configure karma config to use `karma-coverage` together with `karma-remap-coverage`: | ||
@@ -23,7 +24,14 @@ * add `remap-coverage` to reporters list: `reporters: ['progress', 'coverage', 'remap-coverage']` | ||
###remapCoverageReporter format | ||
Plain object, key is report type, value - path to file/dir where to save report. | ||
Reporters like `text-summary`, `text-lcov` and `teamcity` can output to console as well - in this case just provide any falsy (`null`, `''`, etc) value instead of path. | ||
##remapCoverageReporter format | ||
Key-value pairs where key is report type and value - path to file/dir where to save it. Reporters like `text-summary`, `text-lcov` and `teamcity` can print out to console as well - in this case just provide any falsy value instead of path. | ||
Example: | ||
```javascript | ||
remapCoverageReporter: { | ||
'text-summary': null, | ||
html: './coverage/html', | ||
cobertura: './coverage/cobertura.xml' | ||
} | ||
``` | ||
###TypeScript + webpack example | ||
##TypeScript + webpack example | ||
Karma config with alternative usage of `karma-webpack` should look something like this: | ||
@@ -30,0 +38,0 @@ |
@@ -27,3 +27,3 @@ 'use strict'; | ||
const dest = options[reportType]; | ||
const prepareDest = new Promise((resolve) => { | ||
const prepareDest = new Promise(resolve => { | ||
// destination dir must exists for file type reports | ||
@@ -30,0 +30,0 @@ if (dest && istanbulFileReportTypes.indexOf(reportType) > -1) { |
128256
77