Skip to content

Commit

Permalink
fix: filter out results without file protocol
Browse files Browse the repository at this point in the history
This commit ensures that the URL of the results starts with `file://`. Some files produce an extra result without the `file` protocol, this result interferes then without report merging.

See bcoe#14
  • Loading branch information
demurgos committed Jul 29, 2018
1 parent f14508e commit ef7cac6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ const exclude = Exclude({

function filterResult (result) {
result = result.filter(({url}) => {
if (!url.startsWith('file://')) {
// Sometimes a file produce an extra result without the `file://`
// protocol (simply its absolute path). This extra result has a different
// structure that breaks report merging, so we filter it out. See #14
return false
}
url = url.replace('file://', '')
return isAbsolute(url) &&
exclude.shouldInstrument(url) &&
Expand Down

0 comments on commit ef7cac6

Please sign in to comment.