File tree 2 files changed +6
-5
lines changed
packages/istanbul-reports/lib
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ const LcovOnlyReport = require('../lcovonly');
8
8
const HtmlReport = require ( '../html' ) ;
9
9
10
10
class LcovReport extends ReportBase {
11
- constructor ( ) {
11
+ constructor ( opts ) {
12
12
super ( ) ;
13
-
14
- this . lcov = new LcovOnlyReport ( { file : 'lcov.info' } ) ;
13
+ this . lcov = new LcovOnlyReport ( { file : 'lcov.info' , ...opts } ) ;
15
14
this . html = new HtmlReport ( { subdir : 'lcov-report' } ) ;
16
15
}
17
16
}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class LcovOnlyReport extends ReportBase {
9
9
constructor ( opts ) {
10
10
super ( ) ;
11
11
this . file = opts . file || 'lcov.info' ;
12
+ this . projectRoot = opts . projectRoot || process . cwd ( ) ;
12
13
this . contentWriter = null ;
13
14
}
14
15
@@ -25,9 +26,10 @@ class LcovOnlyReport extends ReportBase {
25
26
const branches = fc . b ;
26
27
const branchMap = fc . branchMap ;
27
28
const summary = node . getCoverageSummary ( ) ;
29
+ const path = require ( 'path' ) ;
28
30
29
- writer . println ( 'TN:' ) ; //no test name
30
- writer . println ( 'SF:' + fc . path ) ;
31
+ writer . println ( 'TN:' ) ; //no test nam
32
+ writer . println ( 'SF:' + path . relative ( this . projectRoot , fc . path ) ) ;
31
33
32
34
Object . values ( functionMap ) . forEach ( meta => {
33
35
writer . println ( 'FN:' + [ meta . decl . start . line , meta . name ] . join ( ',' ) ) ;
You can’t perform that action at this time.
0 commit comments