History.md
import keyword. #1551before and after hooks. This enables inheritance between parent and child modules, and fixes leaks between last test and after hooks. (Ray Cohen) #1328QUnit.config.reporters.html for disabling the HTML Reporter. #1711QUnit.urlParams unconditionally. 57c2dbcffcQUnit global unconditionally. #1771assert.expect() to exclude assert.step() calls from count. (Kyle Simpson) #1226id=qunit element does not exist. #1711#qunit-banner from H2 to DIV, to fix WCAG compliance. #1427#qunit-testresult from P to DIV, to fix HTML serialization. #1301running class to test items. 1551120536QUnit.config.currentModule for the initial unnamed module to be a complete object. 5812597b7fQUnit.config.maxDepth. 0a26e2c883 test suites. a729421411QUnit.load(). #1084QUnit.onError() and QUnit.onUnhandledRejection() in favor of QUnit.onUncaughtException().details.modules[].tests from QUnit.begin() event.QUnit.dump.HTML and QUnit.dump.multiline. 8e881f5087<div id="qunit"> instead. Check Browser Runner § Getting started.QUnit.config.testFilter to programmatically filter tests. (NullVoxPopuli, Sebastian Gbudje) #1814QUnit.test.only(). 4b87bc6aa5error event listeners, to improve reporting of early errors. 7c2f871ac3FYI:
CLI: Add .mjs and .cjs to the default file extensions when reading a test directory.
These have been monitored by watch mode since QUnit 2.18, but were not loaded or executed
unless you passed them as individual files, or used your own glob like test/*.{js,mjs,cjs}.
If you currently pass a directory to the QUnit CLI and have matching .mjs or .cjs
files that should not be executed, you can opt-out by passing test/*.js or
test/**/*.js explicitly instead of test/.
CLI: Add stacktrace cleaning by omitting or greying out internal QUnit and Node.js frames in TAP reporter. #1795. #1789
Learn more about Cleaner stack traces on the QUnit Blog.
Core: Add QUnit.config.reporters.tap for enabling TAP via preconfig. #1711
Core: Add memory to the runEnd event to allow late listeners. This helps browser integrations that only relay a summary. 27a33d1593
--seed option eating the file argument. #1691expected: undefined under error messages in TAP reporter. #1794<label> to wrap <select> for multi-value urlConfig item. #1773QUnit.test.each() to simple array values. #1733QUnit.test.if() and QUnit.module.if(). (Timo Tijhof) #1772assert.expect() counts steps for assert.verifySteps(). #1226QUnit.stack() in Safari. #1776assert.closeTo() for float-friendly number comparisons. (Timo Tijhof) #1735QUnit.load() and document migration path at https://qunitjs.com/api/QUnit/load/. (Timo Tijhof) #1743sinon.useFakeTimers in IE 10 and IE 11. (Timmy Willison) #1738assert.async() after assert.timeout(). (Timo Tijhof) #1705QUnit.reporters.perf. (Timo Tijhof) #1714assert.async() parameter. (Zixin Yin) #1721inArray by using Array.prototype.includes when possible. (Izel Nakri)config.timeoutHandler from last async test. (Sergey Astapov) #1708config.noglobals by refactoring slow mutations. (Izel Nakri) #1697assert.deepEqual() and QUnit.equiv(). (Izel Nakri) #1700--module option. (Shachar) #1680moduleId to QUnit.begin() details object.beginDetails.modules. e31c8d37b6 #1664assert.propContains() for partial object comparison. (Izel Nakri) #1668QUnit.hooks to globally add beforeEach and afterEach. (Timo Tijhof) #1475.ts files when TypeScript is used. (Timo Tijhof) #1669.json, .cjs, and .mjs files. #1676QUnit.module.only() closure. (Steve McClure) #1645display: none regression with the "global failure" message. (Timo Tijhof) #1651error event for bailing on uncaught errors. (Timo Tijhof) #1638Core: The internal QUnit.onError and QUnit.onUnhandledRejection callbacks are deprecated. #1638
These were undocumented, but may have been used in a fork or other custom runner for QUnit.
Switch to the supported QUnit.onUncaughtException instead.
assert.throws() and assert.rejects(). (Steve McClure) #1637QUnit.begin(). (Timo Tijhof) #1446QUnit.done(). (Timo Tijhof) #1629Core: New QUnit.test.each() method to test with data providers. (Ventuno) #1568
Core: New failOnZeroTests configuration option. (Brenden Palmer)
Core: New QUnit.reporters interface. (Timo Tijhof) f8948c9 js-reporters#133
This introduces support for using the tap reporter in a browser.
This was previously limited to the CLI.
assert.async() callback came from. (Steve McClure) #1599QUnit.module.only() regression where some unrelated modules also executed. (Steve McClure) #1610js-reporters to 2.0.0. #1577assert.throws() to fail gracefully when expected class does not match. (Steve McClure) #1530Infinity value, previously became null. (Timo Tijhof) #1406console object is mocked. (Timo Tijhof) #1340commander to 7.1.0. (Timo Tijhof) #1564testItem in testDone callback. (Timo Tijhof)main and navigation ARIA roles. (Steve McClure) #1427QUnit.module.only logic for unscoped modules. (Steve McClure) #1272assert.timeout() bug causing a non-async test to fail. #1539suiteEnd emits correctly with active filters. (Stephen Yeung) #1416Map global in older browsers. (Timo Tijhof)QUnit.test.* aliases for QUnit.only(), QUnit.skip(), and QUnit.todo(). (Steve McClure) #1496assert.throws() expected callback. (Steve McClure) #1492node-watch and commander dependencies. (Timo Tijhof) #1500QUnit.extend(). (Steve McClure)actual whitespace with expected in TapReporter. (Robert Jackson) js-reporters/js-reporters#107 #1481tiny-glob. #1476assert.true() and assert.false() methods. (Ventuno) #1445hidepassed is set. (Ray Cohen) #1208--watch option, affected Node 14 on Linux. #1448#qunit-fixture. (XhmikosR) #1437QUnit.only-marked tests. (Ventuno) #1436assert.timeout() replace the timeout if config.timeout was already set. (Stephen Yeung) #1400unsafe-inline. (jelhan) #1369assert.throws() as strings. #1333details.source. (Shlomi Fish) #1341QUnit.begin, QUnit.moduleStart, QUnit.testStart, QUnit.testDone, QUnit.moduleDone, and QUnit.done. (Stephen Yeung) #1307running class to list items, for use by plugins. This was previously removed in 2.7.0. #1323performance.measure. (Gabriel Csapo)fsevents extension by upgrading the sane package. (Stefan Penner) #1314assert.pushResult(). (Ger Hobbelt) #1298fsevents extension for Node 10 compatibility. (Tobias Bieniek) #1295--require option. (Trent Willis) #1271assert.step().undefined and other falsy rejection values in assert.rejects().assert.verifySteps() before exposing to logging callbacks. #1267#qunit-fixture between tests. (Robert Jackson) #1250assert.step() without assert.verifySteps().assert.rejects() method. (Robert Jackson) #1238assert.verifySteps() method now resets the steps buffer, making it easier to use multiple times in a single test. #1233setTimeout processing code. #1246QUnit.test() callback.assert.timeout() for setting per-test timeout durations. (Trent Willis) #1165hooks.beforeEach() and hooks.afterEach().typeof obj in QUnit.objectType.QUnit.module.only() method. (Brahim Arkni) #1179QUnit.module.skip() method. (Brahim Arkni) #1193QUnit.module.todo() method. (Brahim Arkni) #1195assert.deepEqual(). (Jing Wu) #1192hidepassed is set.Test#pushFailure now calls Test#pushResult internally.QUnit.todo() method. (Trent Willis) #1080assert.step() and assert.verifySteps() methods. (Trent Willis) #1075assert.push().QUnit.start() no longer requires calling QUnit.load() first.config.storage option.QUnit.equiv object methods comparison.Object.prototype properties.QUnit.load().Symbol type.QUnit.config.autorun.assert.throws() signature with string expected value.before and after module hooks. (Trent Willis) #919QUnit.config.autorun.assert.throws() signature with string expected value.before and after module hooks.QUnit.config.module.moduleId-based filtering.QUnit.config.seed for running tests in pseudo-random order.QUnit.equiv.assert.pushResult() method. (YongWoo Jeon) #920assert.deepEqual() and QUnit.equiv(). (Richard Gibson) #895assert.deepEqual().assert.raises() to the global scope.callCount parameter to assert.async().QUnit.only() method. (Erik Benoist) #496QUnit.equiv.QUnit.start fails if called with a non-numeric argument.QUnit.module(). (Stephen Jones) #543Assert: Add support for ES6 Map and Set to equiv for assert.deepEqual(). (Toh Chee Chuan) #833
Core: New QUnit.stack() method. #801
Core: Release module hooks to avoid memory leaks. (Stefan Penner) #841
Dump: Escape backslash when quoting strings.
HTML Reporter: Avoid readyState issue with PhantomJS.
HTML Reporter: HTML reporter enhancements for negative asserts.
HTML Reporter: Show diff only when it helps. 1.18.0 / 2015-04-03 ==================
Assert: New assert.notOk() for asserting falsy values. #745
Core: Expose Dump maxDepth property.
Core: Expose QUnit version as QUnit.version property.
Dump: Fix .name/.property doublettes.
HTML Reporter: New diff using Google's Diff-Patch-Match library.
HTML Reporter: Make it more obvious why diff is suppressed.
HTML Reporter: Change display text for bad tests.
HTML Reporter: Fix checkbox and select handling in IE <9.
HTML Reporter: Fix test filter without any module.
HTML Reporter: Retain failed tests numbers.
assert.async() method. (James M. Greene) #534assert.raises().QUnit.skip() method. (Leo Balter) #637QUnit.moduleDone() data.QUnit.test() now supports returning Promise and async functions. (James M. Greene) #632url() helper to output ?foo instead of ?foo=true.assert.async() flows are resolved.Error#stack without throwing when available.assert argument in your test to get the full benefit of this. (Leo Balter) #374assert.ok() to include the exact received value.raises, same, and equals methods. Use throws, deepEqual, and equal instead.totalTests for total number of tests to QUnit.begin() data.QUnit.jsDump to QUnit.dump, the old name is kept as deprecated alias and may be removed later.assert.throws().assert.throws() now supports comparing to Error instances.assert.throws() now supports comparing to error strings.QUnit.config.urlConfig.raises(), deprecated in 2012.id function for selection elements in two places that were not using it. #463name property to the test run. #389assert.ok() shouldn't be undefined in 'log' event.assert.propEqual() and assert.notPropEqual(). (Timo Tijhof) #317.testSuites().WebPage#onCallback.throws ES3 compatible. (Mathias Bynens)jsDump.node. (Timo Tijhof) #380QUnit.init happened. #358assert.deepEqual() now recognizes the ES6 sticky "y" flag for RegExp objects. #284QUnit.expect() without arguments behave as a getter. #226QUnit.log(). #296assert.raises() to assert.throws(), keeping an alias for compat. #267qunitjs package name.assert.raises() being reported as global exception in IE. #257module url parameter. #252QUnit.assert object, globals remain for compat. (Timo Tijhof) #244assert.deepEqual(). #250config.requireExpects option. #207exports object to detect a CommonJS environment, fixes compat with RequireJS. #237results data to QUnit.jUnitReport callback argument. The function accepts one argument shaped as { xml: '<?xml ...', results: { failed: 0, passed: 0, total: 0, time: 0 } }. (Jonathan Sanchez) #216this test context to assert.raises() block. (Keith Cirkel) #217assert.expect(0) is called. #178QUnit.pushFailure to log error conditions like exceptions. Accepts stacktrace as second argument, allowing extraction with caught exceptions (useful even in Safari). #210notrycatch option to setup and teardown hooks. #203 #204test() context, make sure source is provided even for ok(). #98test(). Most obscure, never used anywhere. test() is still heavily overloaded with argument shifting, this makes it a little more sane. #172outerHTML for Firefox < 11. Use cloneNode instead.document.title before inserting into markup. #127#qunit-fixture. #114deepEqual to test objects with null prototype against object literals. (Domenic Denicola) #170start() call to use QUnit.start(), since global is not exported in CommonJS runtimes, such as Node.js. (Antoine Musso) #168asyncTest(), same as in test().length properties as empty arrays in comparisons. (Trevor Parscal) #164expect(0) as expected, i.e. expect(0); ok(true, foo); will cause a test to fail. (Markus Messner-Chaney) #158First stable release.