GeezerVison is showing github.com — test_runner: added colors to dot reporter · nodejs/node@4887213
File tree
Expand file treeCollapse file tree
Open diff view settings
lib/internal/test_runner/reporter test/fixtures/test-runner/output
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/test_runner/reporter/dot.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,10 +12,10 @@ module.exports = async function* dot(source) { |
12 | 12 | const failedTests = []; |
13 | 13 | for await (const { type, data } of source) { |
14 | 14 | if (type === 'test:pass') { |
15 | | - yield '.'; |
| 15 | + yield `${colors.green}.${colors.clear}`; |
16 | 16 | } |
17 | 17 | if (type === 'test:fail') { |
18 | | - yield 'X'; |
| 18 | + yield `${colors.red}X${colors.clear}`; |
19 | 19 | ArrayPrototypePush(failedTests, data); |
20 | 20 | } |
21 | 21 | if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { |
|
Collapse file
Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/dot_output_custom_columns.js +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Flags: --test-reporter=dot |
2 | 2 | 'use strict'; |
3 | 3 | process.stdout.columns = 30; |
| 4 | +process.env.FORCE_COLOR = '1'; |
| 5 | +delete process.env.NODE_DISABLE_COLORS; |
| 6 | +delete process.env.NO_COLOR; |
4 | 7 |
|
5 | 8 | const test = require('node:test'); |
6 | 9 | const { setTimeout } = require('timers/promises'); |
|
Collapse file
Copy file name to clipboard +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -.............................. |
2 | | -......................................... |
3 | | -............................. |
| 1 | +[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c |
| 2 | +[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c |
| 3 | +[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c |