Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Reporter: Update testresult display in QUnit 3.0 #1760

Merged
merged 2 commits into from
Jun 11, 2024

Commits on Jun 6, 2024

  1. HTML Reporter: Remove assertion count from qunit-testresult-display

    QUnit 2.21.0:
    > 254 tests completed in 912 milliseconds, with 0 failed, 7 skipped, and 4 todo.
    > 819 assertions of 823 passed, 4 failed.
    
    New:
    > 254 tests completed in 912 milliseconds, with 0 failed, 7 skipped, and 4 todo.
    
    For the reasoning behind this, see https://qunitjs.com/api/callbacks/QUnit.done/
    and the deprecation of the `details` parameter to the QUnit.done() event.
    
    In short, assertions are too low-level and include confusing/distracting mention
    of failures that are not actually failures (but assertions in a todo test).
    Plus it competes for attention when there is already a summary that is adequate
    on its own.
    
    The raw data remains available via `QUnit.config.stats.{all,bad}` for use in
    integrations and plugins, although this is undocumented and not encouraged.
    The recommendation is to use the `runEnd` and its stable test counts instead,
    <https://qunitjs.com/api/callbacks/QUnit.on/#the-runend-event>.
    Krinkle committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    f333043 View commit details
    Browse the repository at this point in the history
  2. HTML Reporter: Report time as seconds in qunit-testresult-display

    QUnit 2.21.0:
    > 254 tests completed in 912 milliseconds, with 0 failed, 7 skipped, and 4 todo.
    > 819 assertions of 823 passed, 4 failed.
    
    New:
    > 254 tests completed in 0.9 seconds, with 0 failed, 7 skipped, and 4 todo.
    
    This is a more human-scale number. Rounding is opionated. I went with 1 digit
    of precision, and thus reporting 123ms as 0.1s. For number smaller than 100ms,
    I opted for a longer format with at always 1 significant digit, so reporting
    20ms as 0.02s, instead of e.g. forcefully rounding either down to a confusing
    0.0s or a deceptively high 0.1s. It allows for a little pride/recognition of
    small numbers. As a GUI, this is not meant to be machine readable either way.
    In practice, numbers below 0.1s are rare.
    
    The `runEnd` event data is unchanged, and continues to report in milliseconds.
    Krinkle committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    2d2b0dc View commit details
    Browse the repository at this point in the history