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: nix dead reporter code · nodejs/node@a5a4c3e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/test_runner/reporter
    • spec.js
    • utils.js
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
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SpecReporter extends Transform {
5353
}
5454

5555
this.#failedTests = []; // Clean up the failed tests
56-
return ArrayPrototypeJoin(results, '\n'); ;
56+
return ArrayPrototypeJoin(results, '\n');
5757
}
5858
#handleTestReportEvent(type, data) {
5959
const subtest = ArrayPrototypeShift(this.#stack); // This is the matching `test:start` event
@@ -71,13 +71,8 @@ class SpecReporter extends Transform {
7171
ArrayPrototypeUnshift(this.#reported, msg);
7272
prefix += `${indent(msg.nesting)}${reporterUnicodeSymbolMap['arrow:right']}${msg.name}\n`;
7373
}
74-
let hasChildren = false;
75-
if (this.#reported[0] && this.#reported[0].nesting === data.nesting && this.#reported[0].name === data.name) {
76-
ArrayPrototypeShift(this.#reported);
77-
hasChildren = true;
78-
}
7974
const indentation = indent(data.nesting);
80-
return `${formatTestReport(type, data, prefix, indentation, hasChildren, false)}\n`;
75+
return `${formatTestReport(type, data, false, prefix, indentation)}\n`;
8176
}
8277
#handleEvent({ type, data }) {
8378
switch (type) {
Collapse file

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

Copy file name to clipboardExpand all lines: lib/internal/test_runner/reporter/utils.js
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ function indent(nesting) {
5858
}
5959

6060
function formatError(error, indent) {
61-
if (!error) return '';
6261
const err = error.code === 'ERR_TEST_FAILURE' ? error.cause : error;
6362
const message = ArrayPrototypeJoin(
6463
RegExpPrototypeSymbolSplit(
@@ -68,7 +67,7 @@ function formatError(error, indent) {
6867
return `\n${indent} ${message}\n`;
6968
}
7069

71-
function formatTestReport(type, data, prefix = '', indent = '', hasChildren = false, showErrorDetails = true) {
70+
function formatTestReport(type, data, showErrorDetails = true, prefix = '', indent = '') {
7271
let color = reporterColorMap[type] ?? colors.white;
7372
let symbol = reporterUnicodeSymbolMap[type] ?? ' ';
7473
const { skip, todo, expectFailure } = data;
@@ -83,10 +82,7 @@ function formatTestReport(type, data, prefix = '', indent = '', hasChildren = fa
8382
title += ` # EXPECTED FAILURE`;
8483
}
8584

86-
const error = showErrorDetails ? formatError(data.details?.error, indent) : '';
87-
const err = hasChildren ?
88-
(!error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`) :
89-
error;
85+
const err = showErrorDetails && data.details?.error ? formatError(data.details.error, indent) : '';
9086

9187
if (skip !== undefined) {
9288
color = colors.gray;

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.