Skip to content

Commit

Permalink
fix: now uses path.join to join the prefix to the filename
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvalk committed Sep 8, 2022
1 parent 473fc0a commit 81f5bc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cobertura.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fs = require("fs").promises;
const xml2js = require("xml2js");
const util = require("util");
const glob = require("glob-promise");
const pathLib = require("path");
const parseString = util.promisify(xml2js.parseString);

/**
Expand All @@ -24,7 +25,10 @@ async function readCoverageFromFile(path, options) {
.map((klass) => {
return {
...calculateRates(klass),
filename: (options.prefixPath || "") + klass["filename"],
filename:
options.prefixPath != null
? pathLib.join(options.prefixPath, klass["filename"])
: klass["filename"],
name: klass["name"],
missing: missingLines(klass),
};
Expand Down

0 comments on commit 81f5bc3

Please sign in to comment.