Skip to content

Commit

Permalink
Merge branch 'master' into 131-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanluker committed Jan 28, 2018
2 parents fa32d43 + cbad7d1 commit 22d75cf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/indicators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,16 @@ export class Indicators {
if (err) { return reject(err); }
const section = data.find((lcovSection) => {
// consider windows and linux file paths
const cleanFile = file.replace(/[\\\/]/g, "");
const cleanLcovFileSection = lcovSection.file.replace(/[\\\/]/g, "");
let cleanFile = file.replace(/[\\\/]/g, "");
let cleanLcovFileSection = lcovSection.file.replace(/[\\\/]/g, "");

// on Windows remove drive letter from path because of cobertura format
// also convert both path to lowercase because Windows's filesystem is case insensitive
if ( process.platform === "win32" ) {
cleanFile = cleanFile.substr(2).toLowerCase();
cleanLcovFileSection = cleanLcovFileSection.toLowerCase();
}

return cleanFile.includes(cleanLcovFileSection);
});

Expand Down

0 comments on commit 22d75cf

Please sign in to comment.