Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qunitjs/qunit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.23.1
Choose a base ref
...
head repository: qunitjs/qunit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.24.2
Choose a head ref
  • 17 commits
  • 52 files changed
  • 1 contributor

Commits on Jan 18, 2025

  1. Core: Exclude or grey internal stack frames in TAP reporter (2.x back…

    …port)
    
    Cherry-picked from 9fed286 (3.0.0-dev):
    
    > Core: Exclude or grey internal frames from stack traces in TAP reporter
    > Internal frames are those from qunit.js, or Node.js runtime.
    >
    > * Remove any internal frames from the top of the stack.
    > * Grey out later internal frames anywhere in the stack.
    >
    > This change is applied to the TAP reporter, which the QUnit CLI uses
    > by default.
    >
    > Ref #1789.
    
    Cherry-picked from 95105aa (3.0.0-dev):
    
    > Fix fragile code in stracktrace.js that previously worked only because
    > of Babel transformations masking a violation of the Temporal Dead Zone
    > between `const fileName` and the functions it uses to compute that
    > value.
    Krinkle committed Jan 18, 2025
    Configuration menu
    Copy the full SHA
    c244704 View commit details
    Browse the repository at this point in the history
  2. CLI: Apply trace cleaning and internal greying to assertion stack (2.…

    …x backport)
    
    Cherry-picked from 276e09d (3.0.0-dev).
    > Ref #1795.
    Krinkle committed Jan 18, 2025
    Configuration menu
    Copy the full SHA
    62f6d7d View commit details
    Browse the repository at this point in the history
  3. CLI: Include .mjs and .cjs in default test file extensions

    These have been included by watch mode since QUnit 2.18, but so far
    only benefited you there if you manually passed these as individual
    files, or loaded them indirectly at runtime, or used your own glob
    that includes mjs and/or cjs.
    
    If you currently run qunit by passing a directory and have matching
    files that you want to skip, opt-out by passing `test/*.js` or
    `test/**/*.js` explicitly instead of `test/`.
    
    Follows-up #1676.
    
    Cherry-picked from 6f72eeb (3.0.0-dev).
    
    Cherry-picked from 53ee0a7 (3.0.0-dev).
    Krinkle committed Jan 18, 2025
    Configuration menu
    Copy the full SHA
    db1d3be View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2025

  1. Core: Support TAP preconfig via QUnit.config.reporters

    Cherry-picked from 05e15ba (3.0.0-dev).
    
    Ref #1711.
    Krinkle committed Jan 19, 2025
    Configuration menu
    Copy the full SHA
    61c2501 View commit details
    Browse the repository at this point in the history
  2. HTML Reporter: Fix unexpected pointer cursor on "Source:" label

    `#qunit-tests li strong` also applied to `#qunit-tests li .qunit-source strong`
    
    Cherry-picked from 52bfa69 (3.0.0-dev).
    Krinkle committed Jan 19, 2025
    Configuration menu
    Copy the full SHA
    f8cce2b View commit details
    Browse the repository at this point in the history
  3. Demos: Introduce q4000 benchmark

    Cherry-picked from 58d93b9 (3.0.0-dev).
    Krinkle committed Jan 19, 2025
    Configuration menu
    Copy the full SHA
    567ab7d View commit details
    Browse the repository at this point in the history
  4. HTML Reporter: Faster "Hide passed" toggling on large test suites

    Optimize the hidepassed click handler for large test suites by
    avoiding internal function call overhead for the iterator, as well
    as copying cost for the array. Shaves off ~100ms milliseconds on the
    q4000 demo 1.65s to 1.5s (Chrome, CPU throttle 6x), and seems to defer
    some unattributed costs to outside the critical path.
    
    Cherry-picked from a729421 (3.0.0-dev).
    Krinkle committed Jan 19, 2025
    Configuration menu
    Copy the full SHA
    b13ade0 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2025

  1. Core: Add memory to the runEnd event to allow late event listeners

    While this is not in any way a documented API, it is quite common for
    QUnit runners that are based on Selenium/Webdriver to use HTML scraping
    to obtain a simple summary of whether the run passed.
    
    Intruce memory for `runEnd` event so that anything JS-based has a
    stable and documented way to obtain the result in a machine-readable
    format, without needing to resort to HTML scraping.
    
    One common reason sometimes avoid the event emitter is that, depending
    on various circumstances, a custom test runner might end up injecting
    code slightly too late, at which point JS code to listen for our event
    might not fire, whereas the DOM is still available. This is rare,
    but can happen:
    
    * if the file is served as-is.
    
      browserstack-runner and QTap solves this by proxying the HTML file
      and inject an inline script to reliable listen early.
    
      Karma solves this by proxing the test framework instead (qunit.js)
      and adapting it to include relevant event listeners upfront.
    
    * and, if the browser is driven without early JS control.
      When WebDriver v1 is used, something like webdriver "execute" is
      not guruanteed to run before DOM-ready or window.onload. If the
      Node.js process is slow or far away from the browser (e.g. cloud),
      and if the test suite is relatively small/fast, then the injected
      code might arrive after the tests have already finished.
    
      grunt-contrib-qunit avoids this by using Puppeteer and
      its `Page.evaluateOnNewDocument()` method, to reliably run a script
      before any others.
    
    * and, if the test is relatively small/fast.
    
    Example at mauriciolauffer/wdio-qunit-service#13
    
    Solve this once and for all by adding memory to the `runEnd` event.
    This allows late event listers to handle the event retroactively.
    
    Cherry-picked from 8f25f26 (3.0.0-dev).
    Krinkle committed Jan 20, 2025
    Configuration menu
    Copy the full SHA
    27a33d1 View commit details
    Browse the repository at this point in the history
  2. Release 2.24.0

    Krinkle committed Jan 20, 2025
    Configuration menu
    Copy the full SHA
    ca5e5ac View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2025

  1. CLI: Fix TAP compliance for actual/expected indent and skip/todo colors

    Cherry-picked from adc4493 (3.0.0-dev).
    Krinkle committed Jan 25, 2025
    Configuration menu
    Copy the full SHA
    b4d48fc View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2025

  1. CLI: Fix TAP compliance for early errors (e.g. syntax error in test f…

    …ile)
    
    Cherry-picked from 62ca15a (3.0.0-dev).
    > Core: Convert "No tests were run." from fake test to error
    
    Early errors produced output like so:
    
    ```
    not ok 1 global failure
      ---
      message: ReferenceError: boom is not defined
      stack: |
        ReferenceError: boom is not defined
            at /example.test.js
      ...
    Bail out! ReferenceError: boom is not defined
    TAP version 13
    1..1
    ```
    
    Instead of:
    
    ```
    TAP version 13
    not ok 1 global failure
      ---
      message: ReferenceError: boom is not defined
      stack: |
        ReferenceError: boom is not defined
            at /example.test.js
      ...
    Bail out! ReferenceError: boom is not defined
    1..1
    ```
    
    Because prior to the introduction of the "error" event in 2.17.0,
    the only failures were test failures, and those would not begin until
    after QUnit.begin() / "runStart" event.
    Krinkle committed Jan 26, 2025
    Configuration menu
    Copy the full SHA
    01f7780 View commit details
    Browse the repository at this point in the history
  2. Core: Add memory to the error event to allow late event listeners

    Cherry-picked from 15acb36 (3.0.0-dev).
    > HTML Reporter: Add support for displaying early errors
    > Ref #1786.
    Krinkle committed Jan 26, 2025
    Configuration menu
    Copy the full SHA
    7c2f871 View commit details
    Browse the repository at this point in the history
  3. Release 2.24.1

    Krinkle committed Jan 26, 2025
    Configuration menu
    Copy the full SHA
    00aa314 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2025

  1. Build: Upgrade from ubuntu-20 to ubuntu-22, drop SpiderMonkey 68 cove…

    …rage
    
    Cherry-picked from 497748b (3.0.0-dev).
    Krinkle committed Oct 10, 2025
    Configuration menu
    Copy the full SHA
    7d0c65c View commit details
    Browse the repository at this point in the history
  2. Tests: Run TapReporter independently of stdout.isTTY or env.FORCE_COLOR

    Cherry-picked from abeac18 (3.0.0-dev).
    
    > Tests should pass even when running in a subshell or otherwise
    > without TTY or FORCE_COLOR=1.
    Krinkle committed Oct 10, 2025
    Configuration menu
    Copy the full SHA
    a4cbc1c View commit details
    Browse the repository at this point in the history
  3. CLI: Fix TAP compliance for colon in unquoted YAML diag

    Cherry-picked from f0af617 (3.0.0-dev).
    
    > When an assertion message contained a colon followed by a space,
    > and otherwise is a single line of ASCII characters, we formatted it
    > as an unquoted string. This is invalid in YAML 1.2, and thus tap-parser
    > would ignore the diagnostic block.
    >
    > This does not affect the TAP result itself (the test name and failure
    > status are separate from this), and it does not affect the QUnit CLI
    > output where the information is shown either way.
    >
    > When passing the CLI output to tap-parser (such as in QTap), it
    > silently ignored the "diag" block containing the assertion
    > message/actual/expected value, because it is not valid YAML.
    >
    > Note that YAML 1.2 does allow literal colons and hash tags in unquoted
    > strings, when they are not followed by or preceded by a space, but
    > I'm keeping our version simpler by erring toward quoted strings when
    > these appear. Just because we could squeeze one more edge case with
    > plain unquoted strings, doesn't mean we have to. This way keeps our
    > format a bit more intuitive by making it predictable and easy to
    > deduce why a string is quoted or not, based solely on the chars used
    > and not based on obscure YAML internals.
    >
    > Ref https://yaml.org/spec/1.2.2/#733-plain-style
    Krinkle committed Oct 10, 2025
    Configuration menu
    Copy the full SHA
    dbc02fb View commit details
    Browse the repository at this point in the history
  4. Release 2.24.2

    Krinkle committed Oct 10, 2025
    Configuration menu
    Copy the full SHA
    2753920 View commit details
    Browse the repository at this point in the history
Loading