QUnit 3.0.0 Released
đź“— Check out the QUnit 3.0 Upgrade Guide
Added
- Release: Add native ESM distribution, used automatically by Node.js when using the
importkeyword. #1551 - Core: Add module context to
beforeandafterhooks. This enables inheritance between parent and child modules, and fixes leaks between last test andafterhooks. (Ray Cohen) #1328 - Core: Add
QUnit.config.reporters.htmlfor disabling the HTML Reporter. #1711 - Core: Export
QUnit.urlParamsunconditionally. 57c2dbcffc - Core: Export
QUnitglobal unconditionally. #1771 - HTML Reporter: Default theme design update for improved accessibilty, and lots of other fixes.
- HTML Reporter: Add instant render and display for early errors.
Changed
- Core: Enable a default test timeout of 3 seconds. #1483
- Core: Promote warning “Cannot add hook outside the containing module” to error. (Ray Cohen) #1576
- Core: Promote warning “Unexpected test after runEnd” to error. #1377
- Core: Promote warning “QUnit.module() callback must not be async” to error. (Ray Cohen) #1600
- Core: Promote “No tests were run.” from fake test to native error. #1790
- Assert: Change
assert.expect()to excludeassert.step()from count. (Kyle Simpson) #1226
Fixed
- CLI: Fix confusing “No tests” message after an early uncaught error. #1790
- Core: Fix internal
QUnit.config.currentModulefor the initial unnamed module to be a complete object. 5812597b7f - Core: Fix crash when “bad thenable” is returned from global module hook. 3209462b88
- Core: Fix crash when mixing test.only() with module.only(). 99aee51a8a
- Core: Fix QUnit.config.maxDepth to allow changes at runtime. QUnit.dump.maxDepth is now a live alias to
QUnit.config.maxDepth. 0a26e2c883
Removed
- Core: Remove support for Node.js 10-16. Node.js 18 or later is required. (NullVoxPopuli) #1727
- Core: Remove support for PhantomJS. (Steve McClure) #1505
- Core: Remove built-in export for AMD. You can continue to load your application and your QUnit tests with AMD/RequireJS. This change only affects the loading of the qunit.js file itself. Example: Loading with RequireJS. (NullVoxPopuli) #1729
- Core: Remove deprecated
QUnit.load(). #1084 - Core: Remove deprecated
QUnit.onError()andQUnit.onUnhandledRejection()in favor ofQUnit.onUncaughtException(). - Core: Remove undocumented
details.modules[].testsfrom QUnit.begin() event. - Core: Remove undocumented
QUnit.dump.HTMLandQUnit.dump.multiline. 8e881f5087 - HTML Reporter: Remove support for legacy markup. Use
<div id="qunit">instead. Check Browser Runner § Getting started. - Build: Discontinue publishing to the Bower registry for new releases. Review How to install or Getting Started in the browser. #1677