Skip to content

Commit

Permalink
test_runner: make file path relative properly
Browse files Browse the repository at this point in the history
  • Loading branch information
philnash committed Oct 25, 2023
1 parent eb7a3ad commit 3c5ee6b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/internal/test_runner/reporter/lcov.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
'use strict';

const {
StringPrototypeReplace,
} = primordials;


const { relative } = require('path');
const Transform = require('internal/streams/transform');

// This reporter is based on the LCOV format, as described here:
Expand Down Expand Up @@ -37,7 +33,7 @@ class LcovReporter extends Transform {
// For each source file referenced in the .da file, there is a section
// containing filename and coverage data:
// ## SF:\<path to the source file\>
lcov += `SF:${StringPrototypeReplace(file.path, `${workingDirectory}/`, '')}\n`;
lcov += `SF:${relative(workingDirectory, file.path)}\n`;

// Following is a list of line numbers for each function name found in
// the source file:
Expand Down

0 comments on commit 3c5ee6b

Please sign in to comment.