Module: services/test-results

Helpers for formatting test-result badge messages and colors.

Source:

Methods

(inner) renderTestResultBadge(attrs) → {Object}

Render badge data for a test result summary.

Chooses badge color from pass/fail/skip counts and delegates message formatting to renderTestResultMessage.

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Attributes Description
passed number

Number of passing tests.

failed number

Number of failing tests.

skipped number

Number of skipped tests.

total number

Total number of tests.

passedLabel string <optional>

Label for passing tests in verbose mode.

failedLabel string <optional>

Label for failing tests in verbose mode.

skippedLabel string <optional>

Label for skipped tests in verbose mode.

isCompact boolean <optional>

When true, use compact symbols in the message.

Source:
Returns:

Badge message and shields color name.

Type
Object

(inner) renderTestResultMessage(attrs) → {string}

Format test counts into a badge message string.

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Attributes Description
passed number

Number of passing tests.

failed number

Number of failing tests.

skipped number

Number of skipped tests.

total number

Total number of tests.

passedLabel string <optional>

Label for passing tests in verbose mode.

failedLabel string <optional>

Label for failing tests in verbose mode.

skippedLabel string <optional>

Label for skipped tests in verbose mode.

isCompact boolean <optional>

When true, use compact symbols separated by |.

Source:
Returns:

Formatted message, or no tests when total is zero.

Type
string