File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ internals.instrument = function (filename) {
352352 }
353353 }
354354 return commented ;
355- } ) . reduce ( ( a , b ) => a + b ) ;
355+ } ) . reduce ( ( a , b ) => a + b , 0 ) ;
356356 }
357357
358358 return chunks . join ( '' ) ;
Original file line number Diff line number Diff line change @@ -36,6 +36,16 @@ describe('Coverage', () => {
3636 done ( ) ;
3737 } ) ;
3838
39+ it ( 'computes sloc on script that has no comments' , ( done ) => {
40+
41+ const Test = require ( './coverage/nocomment' ) ;
42+ Test . method ( 1 ) ;
43+
44+ const cov = Lab . coverage . analyze ( { coveragePath : Path . join ( __dirname , 'coverage/nocomment' ) } ) ;
45+ expect ( cov . percent ) . to . equal ( 100 ) ;
46+ done ( ) ;
47+ } ) ;
48+
3949 it ( 'instruments and measures coverage' , ( done ) => {
4050
4151 const Test = require ( './coverage/basic' ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const internals = { } ;
4+
5+
6+ exports . method = function ( value ) {
7+
8+ return value ;
9+ } ;
You can’t perform that action at this time.
0 commit comments