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 9, 2022
1 parent 473fc0a commit df4dc10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18497,6 +18497,7 @@ const fs = __nccwpck_require__(5747).promises;
const xml2js = __nccwpck_require__(6189);
const util = __nccwpck_require__(1669);
const glob = __nccwpck_require__(8252);
const pathLib = __nccwpck_require__(5622);
const parseString = util.promisify(xml2js.parseString);

/**
Expand All @@ -18519,7 +18520,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
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 df4dc10

Please sign in to comment.