Skip to content

Commit

Permalink
Closes #79: Handle file URLs in coverage script
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Nov 2, 2018
1 parent 6f2d958 commit b031637
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/helpers/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ process.on("beforeExit", code => {
const impl = path.join(dir, `${path.basename(spec, ".spec.js")}.js`);

for (const scriptCoverage of result) {
try {
if (!path.isAbsolute(scriptCoverage.url)) {
const url = new URL(scriptCoverage.url);

if (url.protocol !== "file:") {
continue;
}

scriptCoverage.url = url.pathname;
}
} catch (err) {
continue;
}

if (scriptCoverage.url !== impl) {
continue;
}
Expand Down

0 comments on commit b031637

Please sign in to comment.