History.md
assert.rejects() and assert.throws(). (Bartosz Dziewoński) #1824--reporter with local script. (Jordan Kasper, Timo Tijhof) #1823QUnit.config.ignoreUnhandledRejections. (Timo Tijhof) #1829QUnit.config.testFilter to programmatically filter tests. (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 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(). #1226assert.closeTo(). (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)config.noglobals by refactoring slow mutations. (Izel Nakri) #1697QUnit.equiv(). (Izel Nakri) #1700--module option. (Shachar) #1680moduleId to QUnit.begin() details object.beginDetails.modules.assert.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 for 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.unsafe-inline.assert.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. #1246assert.timeout() for setting per-test timeout durations.hooks.beforeEach() and hooks.afterEach().typeof obj in QUnit.objectType.QUnit.module.only() method.QUnit.module.skip() method.QUnit.module.todo() method.assert.deepEqual().hidepassed is set.Test#pushFailure now calls Test#pushResult internally.QUnit.todo() method. (Trent Willis) #1080assert.step() and assert.verifySteps() methods. (Trent Willis)(Trent Willis) #1075assert.push().QUnit.start() no longer requires calling QUnit.load() first.config.storage option.Object.prototype properties.QUnit.load().Symbol type.QUnit.config.autorun.assert.throws() signature with string expected value.before and after module hooks.QUnit.config.autorun.assert.throws() signature with string expected value.before and after module hooks.QUnit.config.module.moduleId-based filtering.QUnit.equiv.assert.pushResult() method.assert.deepEqual().assert.raises() to the global scope.callCount parameter to assert.async().QUnit.only() method.QUnit.equiv.QUnit.start fails if called with a non-numeric argument.assert.deepEqual().QUnit.stack() method.assert.notOk() for asserting falsy values.maxDepth property.QUnit.version property.assert.raises().assert.async() method.QUnit.moduleDone() data.QUnit.skip() method.QUnit.test() now supports returning Promise and async functions.url() 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.assert.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.assert.deepEqual(). #250config.requireExpects option. #207exports object to detect a CommonJS environment, fixes compat with RequireJS. #237{ xml:'<?xml ...', results:{failed:0, passed:0, total:0, time:0} }.fail() function that would just log to console, not useful anymore as regular test output is much more useful by now. Move up QUnit.reset() call to just make that another failed assertion. Used to not make a test fail. #210test() 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. #114QUnit.start() as alias for global start() for use in CommonJS runtimes, such as Node.js.asyncTest(), 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. (mmchaney) #158First stable release.