feat: consider tracked files to get absolute paths

This commit is contained in:
Martin Fillafer 2023-03-14 11:40:21 +01:00
parent 0d3dd791da
commit 33125699e3
3 changed files with 23 additions and 4 deletions

11
dist/index.js generated vendored
View file

@ -1494,7 +1494,7 @@ class PytestJunitParser {
const line = Number.parseInt(pos);
if (path && Number.isFinite(line)) {
return {
path: this.getRelativePath(path),
path: this.getAbsolutePath(path),
line,
message: lines[1]
};
@ -1509,6 +1509,15 @@ class PytestJunitParser {
}
return path;
}
getAbsolutePath(path) {
const relativePath = this.getRelativePath(path);
for (const file of this.options.trackedFiles) {
if (file.endsWith(relativePath)) {
return file;
}
}
return relativePath;
}
getWorkDir(path) {
var _a, _b;
return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles)));