8000 test_runner: use `test:` symbol on second print of parent test · nodejs/node@449dad0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 449dad0

Browse files
avivkellertargos
authored andcommitted
test_runner: use test: symbol on second print of parent test
PR-URL: #54956 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 465d050 commit 449dad0

File tree

3 files changed

+6
-8
lines changed
  • 3 files changed

    +6
    -8
    lines changed

    lib/internal/test_runner/reporter/utils.js

    Lines changed: 4 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -72,16 +72,14 @@ function formatTestReport(type, data, prefix = '', indent = '', hasChildren = fa
    7272
    title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
    7373
    }
    7474
    const error = formatError(data.details?.error, indent);
    75-
    if (hasChildren) {
    76-
    // If this test has had children - it was already reported, so slightly modify the output
    77-
    const err = !error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`;
    78-
    return `${prefix}${indent}${color}${reporterUnicodeSymbolMap['arrow:right']}${colors.white}${title}${err}`;
    79-
    }
    75+
    const err = hasChildren ?
    76+
    (!error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`) :
    77+
    error;
    8078
    if (skip !== undefined) {
    8179
    color = colors.gray;
    8280
    symbol = reporterUnicodeSymbolMap['hyphen:minus'];
    8381
    }
    84-
    return `${prefix}${indent}${color}${symbol}${title}${colors.white}${error}`;
    82+
    return `${prefix}${indent}${color}${symbol}${title}${colors.white}${err}`;
    8583
    }
    8684

    8785
    module.exports = {

    test/fixtures/test-runner/output/default_output.snapshot

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -27,7 +27,7 @@
    2727
    [31m✖ should pass but parent fail [90m(*ms)[39m[39m
    2828
    [32m'test did not finish before its parent and was cancelled'[39m
    2929

    30-
    [31m▶ [39mparent [90m(*ms)[39m
    30+
    [31m✖ parent [90m(*ms)[39m[39m
    3131
    [34mℹ tests 6[39m
    3232
    [34mℹ suites 0[39m
    3333
    [34mℹ pass 1[39m

    test/fixtures/test-runner/output/suite-skip-hooks.snapshot

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -12,7 +12,7 @@ AFTER 2
    1212
    ✔ should run 1 (*ms)
    1313
    ﹣ should not run (*ms) # SKIP
    1414
    ✔ should run 2 (*ms)
    15-
    suite runs with mixture of skipped tests (*ms)
    15+
    suite runs with mixture of skipped tests (*ms)
    1616
    ℹ tests 4
    1717
    ℹ suites 2
    1818
    ℹ pass 2

    0 commit comments

    Comments
     (0)
    0