Files
TicketLab_MCP/scripts/remap-lcov.cjs
T
andreferraroandCursor b3f515bb64
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Canceled after 7m29s
fix: run all tests in CI and remap LCOV paths for Sonar
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 15:06:50 -03:00

11 lines
395 B
JavaScript

const fs = require("node:fs");
const path = require("node:path");
const file = path.join("coverage", "lcov.info");
const remapped = fs.readFileSync(file, "utf8").replace(/^SF:(.+)$/gm, (_, p) => {
const norm = String(p).replaceAll("\\", "/");
const match = /(?:^|\/)dist\/(.+)\.js$/.exec(norm);
return match ? `SF:src/${match[1]}.ts` : `SF:${norm}`;
});
fs.writeFileSync(file, remapped);