GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • lib/internal/test_runner/reporter
    • dot.js
  • test/fixtures/test-runner/output
    • dot_output_custom_columns.js
    • dot_output_custom_columns.snapshot
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/test_runner/reporter/dot.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/reporter/dot.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ module.exports = async function* dot(source) {
1212
const failedTests = [];
1313
for await (const { type, data } of source) {
1414
if (type === 'test:pass') {
15-
yield '.';
15+
yield `${colors.green}.${colors.clear}`;
1616
}
1717
if (type === 'test:fail') {
18-
yield 'X';
18+
yield `${colors.red}X${colors.clear}`;
1919
ArrayPrototypePush(failedTests, data);
2020
}
2121
if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) {
Collapse file

‎test/fixtures/test-runner/output/dot_output_custom_columns.js‎

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 numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Flags: --test-reporter=dot
22
'use strict';
33
process.stdout.columns = 30;
4+
process.env.FORCE_COLOR = '1';
5+
delete process.env.NODE_DISABLE_COLORS;
6+
delete process.env.NO_COLOR;
47

58
const test = require('node:test');
69
const { setTimeout } = require('timers/promises');
Collapse file

‎test/fixtures/test-runner/output/dot_output_custom_columns.snapshot‎

Copy file name to clipboard
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
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

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.