karma-coverage-istanbul-reporter
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -5,2 +5,13 @@ # Change Log | ||
<a name="2.0.5"></a> | ||
## [2.0.5](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/compare/v2.0.4...v2.0.5) (2019-02-17) | ||
### Bug Fixes | ||
* correctly strip source file prefixes when no webpack.context is defined ([3c48bf8](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/commit/3c48bf8)) | ||
* don't double-report files with mixed slashes in their names on windows ([38087c2](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/commit/38087c2)) | ||
<a name="2.0.4"></a> | ||
@@ -7,0 +18,0 @@ ## [2.0.4](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/compare/v2.0.3...v2.0.4) (2018-09-08) |
{ | ||
"name": "karma-coverage-istanbul-reporter", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "A karma reporter that uses the latest istanbul 1.x APIs (with full sourcemap support) to report coverage.", | ||
@@ -16,8 +16,6 @@ "main": "src/reporter.js", | ||
"codecov": "cat coverage/lcov.info | codecov", | ||
"commitmsg": "commitlint -e", | ||
"commit": "git-cz", | ||
"prerelease": "npm test", | ||
"release": "standard-version && git push --follow-tags origin master", | ||
"postrelease": "npm publish", | ||
"precommit": "pretty-quick --staged" | ||
"postrelease": "npm publish" | ||
}, | ||
@@ -42,33 +40,33 @@ "repository": { | ||
"dependencies": { | ||
"istanbul-api": "^2.0.5", | ||
"istanbul-api": "^2.1.1", | ||
"minimatch": "^3.0.4" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^7.0.0", | ||
"@commitlint/config-conventional": "^7.0.1", | ||
"@commitlint/prompt": "^7.0.0", | ||
"@types/chai": "^4.1.4", | ||
"@types/mocha": "^5.2.5", | ||
"chai": "^4.0.0", | ||
"@commitlint/cli": "^7.5.2", | ||
"@commitlint/config-conventional": "^7.5.0", | ||
"@commitlint/prompt": "^7.5.0", | ||
"@types/chai": "^4.1.7", | ||
"@types/mocha": "^5.2.6", | ||
"chai": "^4.2.0", | ||
"codecov-lite": "^0.1.3", | ||
"commitizen": "^2.10.1", | ||
"husky": "^0.14.3", | ||
"commitizen": "^3.0.5", | ||
"husky": "^1.3.1", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^3.0.0", | ||
"karma": "^4.0.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^3.0.0", | ||
"karma-webpack": "^4.0.0-rc.6", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.0.1", | ||
"prettier": "^1.14.2", | ||
"pretty-quick": "^1.6.0", | ||
"rimraf": "^2.5.4", | ||
"standard-version": "^4.4.0", | ||
"ts-loader": "^4.5.0", | ||
"tslint": "^5.11.0", | ||
"nyc": "^13.3.0", | ||
"prettier": "^1.16.4", | ||
"pretty-quick": "^1.10.0", | ||
"rimraf": "^2.6.3", | ||
"standard-version": "^5.0.0", | ||
"ts-loader": "^5.3.3", | ||
"tslint": "^5.12.1", | ||
"tslint-loader": "^3.6.0", | ||
"typescript": "^3.0.1", | ||
"webpack": "^4.17.1", | ||
"xo": "^0.22.0" | ||
"typescript": "^3.3.3", | ||
"webpack": "^4.29.4", | ||
"xo": "^0.24.0" | ||
}, | ||
@@ -107,3 +105,9 @@ "nyc": { | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -e", | ||
"pre-commit": "pretty-quick --staged" | ||
} | ||
} | ||
} |
@@ -51,2 +51,3 @@ const istanbul = require('istanbul-api'); | ||
} | ||
if ( | ||
@@ -106,4 +107,9 @@ coverageConfig.skipFilesWithNoCoverage && | ||
if (!coverageConfig.skipFilesWithNoCoverage) { | ||
// On Windows, istanbul returns files with mixed forward/backslashes in them | ||
const fixedFilePaths = {}; | ||
remappedCoverageMap.files().forEach(path => { | ||
fixedFilePaths[util.fixPathSeparators(path)] = true; | ||
}); | ||
coverageMap.files().forEach(path => { | ||
if (!(path in remappedCoverageMap)) { | ||
if (!(util.fixPathSeparators(path) in fixedFilePaths)) { | ||
// Re-add empty coverage record | ||
@@ -184,2 +190,3 @@ remappedCoverageMap.addFileCoverage(path); | ||
} | ||
logThresholdMessage( | ||
@@ -186,0 +193,0 @@ thresholds, |
@@ -22,2 +22,3 @@ const path = require('path'); | ||
} | ||
return filePath; | ||
@@ -28,12 +29,14 @@ } | ||
let { sourceRoot } = sourceMap; | ||
// As per https://webpack.js.org/configuration/entry-context/#context, if no context is specified, the current | ||
// directory that the process is running from should be assumed instead | ||
const context = (webpackConfig && webpackConfig.context) || process.cwd(); | ||
// Fix for https://github.com/mattlewis92/karma-coverage-istanbul-reporter/issues/32 | ||
// The sourceRoot is relative to the project directory and not an absolute path, so add the webpack context to it if set | ||
if ( | ||
webpackConfig && | ||
webpackConfig.context && | ||
sourceMap.sourceRoot && | ||
!sourceMap.sourceRoot.startsWith(webpackConfig.context) && | ||
context && | ||
sourceRoot && | ||
!sourceRoot.startsWith(context) && | ||
!path.isAbsolute(sourceRoot) | ||
) { | ||
sourceRoot = path.join(webpackConfig.context, sourceRoot); | ||
sourceRoot = path.join(context, sourceRoot); | ||
} | ||
@@ -50,2 +53,3 @@ | ||
} | ||
return source; | ||
@@ -88,2 +92,3 @@ }) | ||
} | ||
return false; | ||
@@ -95,4 +100,5 @@ }); | ||
module.exports.fixPathSeparators = fixPathSeparators; | ||
module.exports.fixWebpackSourcePaths = fixWebpackSourcePaths; | ||
module.exports.fixWebpackFilePath = fixWebpackFilePath; | ||
module.exports.overrideThresholds = overrideThresholds; |
26894
279
- Removedpicocolors@1.0.0(transitive)
Updatedistanbul-api@^2.1.1