Releases: mochajs/mocha
v6.1.4
6.1.4 / 2019-04-18
🔒 Security Fixes
- #3877: Upgrade js-yaml, addressing code injection vulnerability (@bjornstar)
v6.1.3
v6.1.2
v6.1.1
v6.1.0
6.1.0 / 2019-04-07
🔒 Security Fixes
- #3845: Update dependency "js-yaml" to v3.13.0 per npm security advisory (@plroebuck)
🎉 Enhancements
- #3766: Make reporter constructor support optional
optionsparameter (@plroebuck) - #3760: Add support for config files with
.jsoncextension (@sstephant)
📠 Deprecations
These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:
🐛 Fixes
- #3829: Use cwd-relative pathname to load config file (@plroebuck)
- #3745: Fix async calls of
this.skip()in "before each" hooks (@juergba) - #3669: Enable
--allow-uncaughtfor uncaught exceptions thrown inside hooks (@givanse)
and some regressions:
- #3848: Fix
Suitecloning by copyingrootproperty (@fatso83) - #3816: Guard against undefined timeout option (@boneskull)
- #3814: Update "yargs" in order to avoid deprecation message (@boneskull)
- #3788: Fix support for multiple node flags (@aginzberg)
📖 Documentation
- mochajs/mocha-examples: New repository of working examples of common configurations using mocha (@craigtaub)
- #3850: Remove pound icon showing on header hover on docs (@jd2rogers2)
- #3812: Add autoprefixer to documentation page CSS (@Munter)
- #3811: Update doc examples "tests.html" (@DavidLi119)
- #3807: Mocha website HTML tweaks (@plroebuck)
- #3793: Update config file example ".mocharc.yml" (@cspotcode)
🔩 Other
- #3830: Replace dependency "findup-sync" with "find-up" for faster startup (@cspotcode)
- #3799: Update devDependencies to fix many npm vulnerabilities (@XhmikosR)
v6.0.2
6.0.2 / 2019-02-25
🐛 Fixes
Two more regressions fixed:
- #3768: Test file paths no longer dropped from
mocha.opts(@boneskull) - #3767:
--requiredoes not break on module names that look like certainnodeflags (@boneskull)
v6.0.1
6.0.1 / 2019-02-21
The obligatory round of post-major-release bugfixes.
🐛 Fixes
These issues were regressions.
- #3754 - Mocha again finds
test.jswhen run without arguments (@plroebuck) - #3756 - Mocha again supports third-party interfaces via
--ui(@boneskull) - #3755 - Fix broken
--watch(@boneskull) - #3759 - Fix unwelcome deprecation notice when Mocha run against languages (CoffeeScript) with implicit return statements; returning a non-
undefinedvalue from adescribecallback is no longer considered deprecated (@boneskull)
📖 Documentation
- #3738 - Upgrade to
@mocha/docdash@2(@tendonstrength) - #3751 - Use preferred names for example config files (@Szauka)
v6.0.0
6.0.0 / 2019-02-18
💥 Breaking Changes
- #3149: Drop Node.js v4.x support (@outsideris)
- #3556: Changes to command-line options (@boneskull):
--grepand--fgrepare now mutually exclusive; attempting to use both will cause Mocha to fail instead of simply ignoring--grep--compilersis no longer supported; attempting to use will cause Mocha to fail with a link to more information-dis no longer an alias for--debug;-dis currently ignored- #3275:
--watch-extensionsno longer impliesjs; it must be explicitly added (@TheDancingCode)
- #2908:
tapreporter emits error messages (@chrmod) - #2819: When conditionally skipping in a
beforehook, subsequentbeforehooks and tests in nested suites are now skipped (@bannmoore) - #627: Emit filepath in "timeout exceeded" exceptions where applicable (@boneskull)
- #3556:
lib/template.htmlhas moved tolib/browser/template.html(@boneskull) - #2576: An exception is now thrown if Mocha fails to parse or find a
mocha.optsat a user-specified path (@plroebuck) - #3458: Instantiating a
Base-extending reporter without aRunnerparameter will throw an exception (@craigtaub) - #3125: For consumers of Mocha's programmatic API, all exceptions thrown from Mocha now have a
codeproperty (and some will have additional metadata). SomeErrormessages have changed. Please use thecodeproperty to checkErrortypes instead of themessageproperty; these descriptions will be localized in the future. (@craigtaub)
📠 Deprecations
These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:
-gcusers should use--gc-globalinstead- Consumers of the function exported by
bin/optionsshould now use theloadMochaOptsorloadOptions(preferred) functions exported by thelib/cli/optionsmodule
Regarding the Mocha class constructor (from lib/mocha):
- Use property
color: falseinstead ofuseColors: false - Use property
timeout: falseinstead ofenableTimeouts: false
All of the above deprecations were introduced by #3556.
mocha.opts is now considered "legacy"; please prefer RC file or package.json over mocha.opts.
🎉 Enhancements
- #3726: Add ability to unload files from
requirecache (@plroebuck)
Enhancements introduced in #3556:
-
Mocha now supports "RC" files in JS, JSON, YAML, or
package.json-based (usingmochaproperty) format.mocharc.js,.mocharc.json,.mocharc.yamlor.mocharc.ymlare valid "rc" file names and will be automatically loaded- Use
--config /path/to/rc/fileto specify an explicit path - Use
--package /path/to/package.jsonto specify an explicitpackage.jsonto read themochaprop from - Use
--no-configor--no-packageto completely disable loading of configuration via RC file andpackage.json, respectively - Configurations are merged as applicable using the priority list:
- Command-line arguments
- RC file
package.jsonmocha.opts- Mocha's own defaults
- Check out these example config files
-
Node/V8 flag support in
mochaexecutable:- Support all allowed
nodeflags as supported by the running version ofnode(also thanks to @demurgos) - Support any V8 flag by prepending
--v8-to the flag name - All flags are also supported via config files,
package.jsonproperties, ormocha.opts - Debug-related flags (e.g.,
--inspect) now imply--no-timeouts - Use of e.g.,
--debugwill automatically invoke--inspectif supported by running version ofnode
- Support all allowed
-
Support negation of any Mocha-specific command-line flag by prepending
--no-to the flag name -
Interfaces now have descriptions when listed using
--interfacesflag -
Mochaconstructor supports all options -
--extensionis now an alias for--watch-extensionsand affects non-watch-mode test runs as well. For example, to run onlytest/*.coffee(nottest/*.js), you can domocha --require coffee-script/register --extensions coffee. -
#3552:
tapreporter is now TAP13-capable (@plroebuck & @mollstam) -
#3535: Mocha's version can now be queried programmatically via public property
Mocha.prototype.version(@plroebuck) -
#2529:
Runnernow emits aretryevent when tests are retried (reporters can listen for this) (@catdad) -
#2962, #3111: In-browser notification support; warn about missing prereqs when
--growlsupplied (@plroebuck)
🐛 Fixes
- #3737: Fix falsy values from options globals (@plroebuck)
- #3707: Fix encapsulation issues for
Suite#_onlyTestsandSuite#_onlySuites(@vkarpov15) - #3711: Fix diagnostic messages dealing with plurality and markup of output (@plroebuck)
- #3723: Fix "reporter-option" to allow comma-separated options (@boneskull)
- #3722: Fix code quality and performance of
lookupFilesandfiles(@plroebuck) - #3650, #3654: Fix noisy error message when no files found (@craigtaub)
- #3632: Tests having an empty title are no longer confused with the "root" suite (@juergba)
- #3666: Fix missing error codes (@vkarpov15)
- #3684: Fix exiting problem in Node.js v11.7.0+ (@addaleax)
- #3691: Fix
--delay(and other boolean options) not working in all cases (@boneskull) - #3692: Fix invalid command-line argument usage not causing actual errors (@boneskull)
- #3698, #3699: Fix debug-related Node.js options not working in all cases (@boneskull)
- #3700: Growl notifications now show the correct number of tests run (@outsideris)
- #3686: Avoid potential ReDoS when diffing large objects (@cyjake)
- #3715: Fix incorrect order of emitted events when used programmatically (@boneskull)
- #3706: Fix regression wherein
--reporter-option/--reporter-optionsdid not support comma-separated key/value pairs (@boneskull) - Fix missing
mocharc.jsonin published package (@boneskull) - #3356:
--no-timeoutsand--timeout 0now does what you'd expect (@boneskull) - #3475: Restore
--no-exitoption (@boneskull) - #3570: Long-running tests now respect
SIGINT(@boneskull) - #2944:
--forbid-onlyand--forbid-pendingnow "fail fast" when encountered on a suite (@outsideris) - #1652, #2951: Fix broken clamping of timeout values ([@plroebuck](https://github.com/plroebuc...
v6.0.0-1
v6.0.0-0
6.0.0-0 / 2019-01-01
Documentation for this release can be found at next.mochajs.org!
Welcome @plroebuck, @craigtaub, & @markowsiak to the team!
💥 Breaking Changes
- #3149: Drop Node.js v4.x support (@outsideris)
- #3556: Changes to command-line options (@boneskull):
--grepand--fgrepare now mutually exclusive; attempting to use both will cause Mocha to fail instead of simply ignoring--grep--compilersis no longer supported; attempting to use will cause Mocha to fail with a link to more information-dis no longer an alias for--debug;-dis currently ignored- #3275:
--watch-extensionsno longer impliesjs; it must be explicitly added (@TheDancingCode)
- #2908:
tapreporter emits error messages (@chrmod) - #2819: When conditionally skipping in a
beforehook, subsequentbeforehooks and tests in nested suites are now skipped (@bannmoore) - #627: Emit filepath in "timeout exceeded" exceptions where applicable (@boneskull)
- #3556:
lib/template.htmlhas moved tolib/browser/template.html(@boneskull) - #2576: An exception is now thrown if Mocha fails to parse or find a
mocha.optsat a user-specified path (@plroebuck) - #3458: Instantiating a
Base-extending reporter without aRunnerparameter will throw an exception (@craigtaub) - #3125: For consumers of Mocha's programmatic API, all exceptions thrown from Mocha now have a
codeproperty (and some will have additional metadata). SomeErrormessages have changed. Please use thecodeproperty to checkErrortypes instead of themessageproperty; these descriptions will be localized in the future. (@craigtaub)
📠 Deprecations
These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:
-gcusers should use--gc-globalinstead- Consumers of the function exported by
bin/optionsshould now use theloadMochaOptsorloadOptions(preferred) functions exported by thelib/cli/optionsmodule
Regarding the Mocha class constructor (from lib/mocha):
- Use property
color: falseinstead ofuseColors: false - Use property
timeout: falseinstead ofenableTimeouts: false
All of the above deprecations were introduced by #3556.
mocha.opts is now considered "legacy"; please prefer RC file or package.json over mocha.opts.
🎉 Enhancements
Enhancements introduced in #3556:
-
Mocha now supports "RC" files in JS, JSON, YAML, or
package.json-based (usingmochaproperty) format.mocharc.js,.mocharc.json,.mocharc.yamlor.mocharc.ymlare valid "rc" file names and will be automatically loaded- Use
--config /path/to/rc/fileto specify an explicit path - Use
--package /path/to/package.jsonto specify an explicitpackage.jsonto read themochaprop from - Use
--no-configor--no-packageto completely disable loading of configuration via RC file andpackage.json, respectively - Configurations are merged as applicable using the priority list:
- Command-line arguments
- RC file
package.jsonmocha.opts- Mocha's own defaults
- Check out these example config files
-
Node/V8 flag support in
mochaexecutable:- Support all allowed
nodeflags as supported by the running version ofnode(also thanks to @demurgos) - Support any V8 flag by prepending
--v8-to the flag name - All flags are also supported via config files,
package.jsonproperties, ormocha.opts - Debug-related flags (e.g.,
--inspect) now imply--no-timeouts - Use of e.g.,
--debugwill automatically invoke--inspectif supported by running version ofnode
- Support all allowed
-
Support negation of any Mocha-specific command-line flag by prepending
--no-to the flag name -
Interfaces now have descriptions when listed using
--interfacesflag -
Mochaconstructor supports all options -
--extensionis now an alias for--watch-extensionsand affects non-watch-mode test runs as well. For example, to run onlytest/*.coffee(nottest/*.js), you can domocha --require coffee-script/register --extensions coffee. -
#3552:
tapreporter is now TAP13-capable (@plroebuck & @mollstam) -
#3535: Mocha's version can now be queried programmatically via public property
Mocha.prototype.version(@plroebuck) -
#2529:
Runnernow emits aretryevent when tests are retried (reporters can listen for this) (@catdad) -
#2962, #3111: In-browser notification support; warn about missing prereqs when
--growlsupplied (@plroebuck)
🐛 Fixes
- #3356:
--no-timeoutsand--timeout 0now does what you'd expect (@boneskull) - #3475: Restore
--no-exitoption (@boneskull) - #3570: Long-running tests now respect
SIGINT(@boneskull) - #2944:
--forbid-onlyand--forbid-pendingnow "fail fast" when encountered on a suite (@outsideris) - #1652, #2951: Fix broken clamping of timeout values (@plroebuck)
- #2095, #3521: Do not log
stdout:prefix in browser console (@Bamieh) - #3595: Fix mochajs.org deployment problems (@papandreou)
- #3518: Improve
utils.isPromise()(@fabiosantoscode) - #3320: Fail gracefully when non-extensible objects are thrown in async tests (@fargies)
- #2475: XUnit does not duplicate test result numbers in "errors" and "failures"; "failures" will always be zero (@mlucool)
- #3398, #3598, #3457, #3617: Fix regression wherein
--bailwould not execute "after" nor "after each" hooks (@juergba) - #3580: Fix potential exception when using XUnit reporter programmatically (@Lana-Light)
- #1304: Do not output color to
TERM=dumb(@plroebuck)
📖 Documentation
- #3525: Improvements to
.github/CONTRIBUTING.md(@markowsiak) - #3466: Update description of
slowoption (@finfin) - #3405: Remove references to bower installations (@goteamtim)
- #3361: Improvements to
--watchdocs (@benglass) - #3136: Improve docs around globbing and shell expansion (@akrawchyk)
- #2819: Update docs around skips and hooks (@bannmoore)
- Many improvements by @outsideris
🔩 Other
- #3557: Use
msuserland module instead of hand-rolled solution (@gizemkeser) - Many CI fixes and other refactor...