Skip to content

Commit 44a2ee2

Browse files
committed
test_runner: fixing PR comments
* Adds lcov reporter to docs examples * Corrects comment with period after URL * Use ReflectConstruct so that the lcov reporter class is usable as a function
1 parent 8c390dc commit 44a2ee2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

doc/api/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,11 @@ to the test runner's output is required, use the events emitted by the
662662
The reporters are available via the `node:test/reporters` module:
663663

664664
```mjs
665-
import { tap, spec, dot, junit } from 'node:test/reporters';
665+
import { tap, spec, dot, junit, lcov } from 'node:test/reporters';
666666
```
667667

668668
```cjs
669-
const { tap, spec, dot, junit } = require('node:test/reporters');
669+
const { tap, spec, dot, junit, lcov } = require('node:test/reporters');
670670
```
671671

672672
### Custom reporters

lib/internal/test_runner/reporter/lcov.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
const Transform = require('internal/streams/transform');
44

55
// This reporter is based on the LCOV format, as described here:
6-
// https://ltp.sourceforge.net/coverage/lcov/geninfo.1.php. Excerpts from this
7-
// documentation are included in the comments that make up the _transform
8-
// function below.
6+
// https://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
7+
// Excerpts from this documentation are included in the comments that make up
8+
// the _transform function below.
99
class LcovReporter extends Transform {
1010
constructor(options) {
1111
super({ ...options, writableObjectMode: true, __proto__: null });

lib/test/reporters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ObjectDefineProperties(module.exports, {
5252
enumerable: true,
5353
get() {
5454
lcov ??= require('internal/test_runner/reporter/lcov');
55-
return lcov;
55+
return ReflectConstruct(lcov, arguments);
5656
},
5757
},
5858
});

0 commit comments

Comments
 (0)