Skip to content

Commit 3a18f6e

Browse files
committed
Update dependencies.
1 parent 9dece07 commit 3a18f6e

File tree

4 files changed

+97
-46
lines changed

4 files changed

+97
-46
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
## Next
44

5+
### Major
6+
7+
- The updated [`kleur`](https://npm.im/kleur) dependency causes subtle differences in which environments get colored console output.
8+
59
### Patch
610

11+
- Updated dependencies.
712
- Simplified the GitHub Actions CI config with the [`npm install-test`](https://docs.npmjs.com/cli/v7/commands/npm-install-test) command.
813
- Removed `npm-debug.log` from the `.gitignore` file as npm [v4.2.0](https://github.com/npm/npm/releases/tag/v4.2.0)+ doesn’t create it in the current working directory.
14+
- Use the `FORCE_COLOR` environment variable in tests to ensure output is colorized.
915
- Improved internal JSDoc.
1016

1117
## 3.0.0

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@
4545
},
4646
"dependencies": {
4747
"@bcoe/v8-coverage": "^0.2.3",
48-
"disposable-directory": "^2.0.0",
49-
"kleur": "^3.0.3"
48+
"disposable-directory": "^3.0.0",
49+
"kleur": "^4.1.3"
5050
},
5151
"devDependencies": {
52-
"eslint": "^7.2.0",
53-
"eslint-config-env": "^14.0.3",
54-
"eslint-config-prettier": "^6.11.0",
55-
"eslint-plugin-import": "^2.21.2",
56-
"eslint-plugin-jsdoc": "^27.0.7",
52+
"eslint": "^7.15.0",
53+
"eslint-config-env": "^15.0.1",
54+
"eslint-config-prettier": "^7.0.0",
55+
"eslint-plugin-import": "^2.22.1",
56+
"eslint-plugin-jsdoc": "^30.7.8",
5757
"eslint-plugin-node": "^11.1.0",
58-
"eslint-plugin-prettier": "^3.1.3",
58+
"eslint-plugin-prettier": "^3.2.0",
5959
"hard-rejection": "^2.1.0",
60-
"jsdoc-md": "^7.0.0",
61-
"prettier": "^2.0.5",
62-
"test-director": "^4.0.1"
60+
"jsdoc-md": "^8.0.0",
61+
"prettier": "^2.2.1",
62+
"test-director": "^5.0.0"
6363
},
6464
"scripts": {
6565
"prepare": "npm run prepare:jsdoc && npm run prepare:prettier",

readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
A simple CLI to run [Node.js](https://nodejs.org) and report code coverage.
66

77
- ✨ Zero config.
8-
- 🏁 ~261 [SLOC](https://en.wikipedia.org/wiki/Source_lines_of_code), written from scratch to use [code coverage features](https://nodejs.org/api/cli.html#cli_node_v8_coverage_dir) built into Node.js v10+.
9-
- 📦 [~312 kB install size](https://packagephobia.now.sh/result?p=coverage-node), compared to [2.02 MB for `c8`](https://packagephobia.now.sh/[email protected]) or [9.01 MB for `nyc`](https://packagephobia.now.sh/[email protected]).
8+
- 🏁 \~261 [SLOC](https://en.wikipedia.org/wiki/Source_lines_of_code), written from scratch to use [code coverage features](https://nodejs.org/api/cli.html#cli_node_v8_coverage_dir) built into Node.js v10+.
9+
- 📦 [\~312 kB install size](https://packagephobia.now.sh/result?p=coverage-node), compared to [2.02 MB for `c8`](https://packagephobia.now.sh/[email protected]) or [9.01 MB for `nyc`](https://packagephobia.now.sh/[email protected]).
1010
- 🖱Displays ignored or uncovered source code ranges as paths, clickable in IDEs such as [VS Code](https://code.visualstudio.com).
1111

1212
## Setup
@@ -31,7 +31,7 @@ In a [`package.json` script](https://docs.npmjs.com/files/package.json#scripts),
3131
## Support
3232

3333
- Linux, macOS.
34-
- Node.js `^10.17.0 || ^12.0.0 || >= 13.7.0`, but for Node.js versions < v13.3 that produce [unreliable coverage data](https://github.com/nodejs/node/issues/25937#issuecomment-563115421) the [`coverage-node` CLI](#cli) skips code coverage and logs a warning.
34+
- Node.js `^10.17.0 || ^12.0.0 || >= 13.7.0`, but for Node.js versions < v13.3 that produce [unreliable coverage data](https://github.com/nodejs/node/issues/25937#issuecomment-563115421) the [`coverage-node` CLI](#cli) skips code coverage and logs a warning.
3535

3636
## Ignored files
3737

@@ -85,7 +85,7 @@ Analyzes [Node.js generated V8 JavaScript code coverage data](https://nodejs.org
8585
| :---------------- | :----- | :--------------------------------- |
8686
| `coverageDirPath` | string | Code coverage data directory path. |
8787

88-
**Returns:** Promise&lt;[CoverageAnalysis](#type-coverageanalysis)> — Resolves the coverage analysis.
88+
**Returns:** Promise<[CoverageAnalysis](#type-coverageanalysis)> — Resolves the coverage analysis.
8989

9090
#### Examples
9191

@@ -212,9 +212,9 @@ _Ways to `require`._
212212
| Property | Type | Description |
213213
| :-- | :-- | :-- |
214214
| `filesCount` | number | Number of files analyzed. |
215-
| `covered` | Array&lt;string> | Covered file absolute paths. |
216-
| `ignored` | Array&lt;[SourceCodeRanges](#type-sourcecoderanges)> | Ignored source code ranges. |
217-
| `uncovered` | Array&lt;[SourceCodeRanges](#type-sourcecoderanges)> | Uncovered source code ranges. |
215+
| `covered` | Array<string> | Covered file absolute paths. |
216+
| `ignored` | Array<[SourceCodeRanges](#type-sourcecoderanges)> | Ignored source code ranges. |
217+
| `uncovered` | Array<[SourceCodeRanges](#type-sourcecoderanges)> | Uncovered source code ranges. |
218218
219219
---
220220
@@ -271,4 +271,4 @@ A source code file with ranges of interest.
271271
| Property | Type | Description |
272272
| :-- | :-- | :-- |
273273
| `path` | string | File absolute path. |
274-
| `ranges` | Array&lt;[SourceCodeRange](#type-sourcecoderange)> | Ranges of interest. |
274+
| `ranges` | Array<[SourceCodeRange](#type-sourcecoderange)> | Ranges of interest. |

test/cli/coverage-node.test.js

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ module.exports = (tests) => {
1616
await disposableDirectory(async (tempDirPath) => {
1717
const filePath = join(tempDirPath, 'index.js');
1818
await fs.promises.writeFile(filePath, "'use strict'");
19-
const { stdout, stderr } = await execFilePromise('node', [
20-
'cli/coverage-node',
21-
filePath,
22-
]);
19+
const { stdout, stderr } = await execFilePromise(
20+
'node',
21+
['cli/coverage-node', filePath],
22+
{
23+
env: {
24+
...process.env,
25+
FORCE_COLOR: 1,
26+
},
27+
}
28+
);
2329

2430
coverageSupported
2531
? strictEqual(
@@ -39,10 +45,16 @@ module.exports = (tests) => {
3945
`// coverage ignore next line
4046
() => {}`
4147
);
42-
const { stdout, stderr } = await execFilePromise('node', [
43-
'cli/coverage-node',
44-
filePath,
45-
]);
48+
const { stdout, stderr } = await execFilePromise(
49+
'node',
50+
['cli/coverage-node', filePath],
51+
{
52+
env: {
53+
...process.env,
54+
FORCE_COLOR: 1,
55+
},
56+
}
57+
);
4658

4759
coverageSupported
4860
? strictEqual(
@@ -64,10 +76,16 @@ module.exports = (tests) => {
6476
let stderr;
6577

6678
try {
67-
({ stdout, stderr } = await execFilePromise('node', [
68-
'cli/coverage-node',
69-
filePath,
70-
]));
79+
({ stdout, stderr } = await execFilePromise(
80+
'node',
81+
['cli/coverage-node', filePath],
82+
{
83+
env: {
84+
...process.env,
85+
FORCE_COLOR: 1,
86+
},
87+
}
88+
));
7189
} catch (error) {
7290
threw = true;
7391
({ stdout, stderr } = error);
@@ -129,10 +147,16 @@ require('${fileFPath}')`
129147
let stderr;
130148

131149
try {
132-
({ stdout, stderr } = await execFilePromise('node', [
133-
'cli/coverage-node',
134-
fileAPath,
135-
]));
150+
({ stdout, stderr } = await execFilePromise(
151+
'node',
152+
['cli/coverage-node', fileAPath],
153+
{
154+
env: {
155+
...process.env,
156+
FORCE_COLOR: 1,
157+
},
158+
}
159+
));
136160
} catch (error) {
137161
threw = true;
138162
({ stdout, stderr } = error);
@@ -167,10 +191,16 @@ require('${fileFPath}')`
167191
await disposableDirectory(async (tempDirPath) => {
168192
const filePath = join(tempDirPath, 'index.js');
169193
await fs.promises.writeFile(filePath, "console.log('Message.')");
170-
const { stdout, stderr } = await execFilePromise('node', [
171-
'cli/coverage-node',
172-
filePath,
173-
]);
194+
const { stdout, stderr } = await execFilePromise(
195+
'node',
196+
['cli/coverage-node', filePath],
197+
{
198+
env: {
199+
...process.env,
200+
FORCE_COLOR: 1,
201+
},
202+
}
203+
);
174204

175205
if (coverageSupported)
176206
strictEqual(
@@ -191,7 +221,12 @@ require('${fileFPath}')`
191221
let threw;
192222

193223
try {
194-
await execFilePromise('node', ['cli/coverage-node', filePath]);
224+
await execFilePromise('node', ['cli/coverage-node', filePath], {
225+
env: {
226+
...process.env,
227+
FORCE_COLOR: 1,
228+
},
229+
});
195230
} catch (error) {
196231
threw = true;
197232
var { stdout, stderr } = error;
@@ -219,11 +254,16 @@ deprecated()`
219254
let threw;
220255

221256
try {
222-
await execFilePromise('node', [
223-
'cli/coverage-node',
224-
'--throw-deprecation',
225-
filePath,
226-
]);
257+
await execFilePromise(
258+
'node',
259+
['cli/coverage-node', '--throw-deprecation', filePath],
260+
{
261+
env: {
262+
...process.env,
263+
FORCE_COLOR: 1,
264+
},
265+
}
266+
);
227267
} catch (error) {
228268
threw = true;
229269
var { stdout, stderr } = error;
@@ -239,7 +279,12 @@ deprecated()`
239279
let threw;
240280

241281
try {
242-
await execFilePromise('node', ['cli/coverage-node']);
282+
await execFilePromise('node', ['cli/coverage-node'], {
283+
env: {
284+
...process.env,
285+
FORCE_COLOR: 1,
286+
},
287+
});
243288
} catch (error) {
244289
threw = true;
245290
var { stdout, stderr } = error;

0 commit comments

Comments
 (0)