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: output errors of suites · nodejs/node@29c68a2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/test_runner/reporter
    • spec.js
  • test
    • fixtures/test-runner/output
      • hooks_spec_reporter.js
      • hooks_spec_reporter.snapshot
    • parallel
      • test-runner-output.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: lib/internal/test_runner/reporter/spec.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ class SpecReporter extends Transform {
7878
} else if (todo !== undefined) {
7979
title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
8080
}
81+
const error = this.#formatError(data.details?.error, indent);
8182
if (hasChildren) {
8283
// If this test has had children - it was already reported, so slightly modify the output
83-
return `${prefix}${indent}${color}${symbols['arrow:right']}${white}${title}\n`;
84+
const err = data.details?.error?.failureType === 'subtestsFailed' ? '' : error;
85+
return `${prefix}${indent}${color}${symbols['arrow:right']}${white}${title}\n${err}`;
8486
}
85-
const error = this.#formatError(data.details?.error, indent);
8687
if (skip !== undefined) {
8788
color = gray;
8889
symbol = symbols['hyphen:minus'];
Collapse file

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

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
require('../../../common');
3+
const fixtures = require('../../../common/fixtures');
4+
const spawn = require('node:child_process').spawn;
5+
6+
const child = spawn(process.execPath,
7+
['--no-warnings', '--test-reporter', 'spec', fixtures.path('test-runner/output/hooks.js')],
8+
{ stdio: 'pipe' });
9+
// eslint-disable-next-line no-control-regex
10+
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, '')));
11+
child.stderr.pipe(process.stderr);

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.