- #4025: Fix duplicate
EVENT_RUN_END
events upon uncaught exception (@juergba) - #4051: Fix "unhide" function in
html
reporter (browser) (@pec9399) - #4063: Fix use of esm in Node.js v8.x (@boneskull)
- #4033: Fix output when multiple async exceptions are thrown (@juergba)
- #4046: Site accessibility fixes (@Mia-jeong)
- #4026: Update docs for custom reporters in browser (@Lindsay-Needs-Sleep)
- #3971: Adopt new OpenJS Foundation Code of Conduct (@craigtaub)
- #3955: tty.getWindowSize is not a function inside a "worker_threads" worker (@1999)
- #3970: remove extraGlobals() (@juergba)
- #3984: Update yargs-unparser to v1.6.0 (@juergba)
- #3983: Package 'esm': spawn child-process for correct loading (@juergba)
- #3986: Update yargs to v13.3.0 and yargs-parser to v13.1.1 (@juergba)
- #3886: fix styles on mochajs.org (@outsideris)
- #3966: Remove jsdoc index.html placeholder from eleventy file structure and fix broken link in jsdoc tutorial (@Munter)
- #3765: Add Matomo to website (@MarioDiaz98)
- #3947: Clarify effect of .skip() (@oliversalzburg)
- #3827: Do not fork child-process if no Node flags are present (@boneskull)
- #3725: Base reporter store ref to console.log, see mocha/wiki (@craigtaub)
- #3942: Fix "No test files found" Error when file is passed via
--file
(@gabegorelick) - #3914: Modify Mocha constructor to accept options
global
orglobals
(@pascalpp) - #3894: Fix parsing of config files with
_mocha
binary (@juergba) - #3834: Fix CLI parsing with default values (@boneskull, @juergba)
- #3831: Fix
--timeout
/--slow
string values and duplicate arguments (@boneskull, @juergba)
- #3906: Document option to define custom report name for XUnit reporter (@pkuczynski)
- #3889: Adds doc links for mocha-examples (@craigtaub)
- #3887: Fix broken links (@toyjhlee)
- #3841: Fix anchors to configuration section (@trescube)
- #3915, #3929: Increase tests coverage for
--watch
options (@geigerzaehler)
- #3953: Collect test files later, prepares improvements to the
--watch
mode behavior (@geigerzaehler) - #3939: Upgrade for npm audit (@boneskull)
- #3930: Extract
runWatch
into separate module (@geigerzaehler) - #3922: Add
mocha.min.js
file to stacktrace filter (@brian-lagerman) - #3919: Update CI config files to use Node-12.x (@plroebuck)
- #3892: Rework reporter tests (@plroebuck)
- #3872: Rename
--exclude
to--ignore
and create alias (@boneskull) - #3963: Hide stacktrace when cli args are missing (@outsideris)
- #3956: Do not redeclare variable in docs array example (@DanielRuf)
- #3957: Remove duplicate line-height property in
mocha.css
(@DanielRuf) - #3960: Don't re-initialize grep option on watch re-run (@geigerzaehler)
- #3877: Upgrade js-yaml, addressing code injection vulnerability (@bjornstar)
- #3863: Fix
yargs
-related global scope pollution (@inukshuk) - #3869: Fix failure when installed w/
pnpm
(@boneskull)
- #3867: Re-publish v6.1.1 from POSIX OS to avoid dropped executable flags (@boneskull)
- #3866: Fix Windows End-of-Line publishing issue (@juergba & @cspotcode)
- #3845: Update dependency "js-yaml" to v3.13.0 per npm security advisory (@plroebuck)
- #3766: Make reporter constructor support optional
options
parameter (@plroebuck) - #3760: Add support for config files with
.jsonc
extension (@sstephant)
These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:
- #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-uncaught
for uncaught exceptions thrown inside hooks (@givanse)
and some regressions:
- #3848: Fix
Suite
cloning by copyingroot
property (@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)
- 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)
- #3830: Replace dependency "findup-sync" with "find-up" for faster startup (@cspotcode)
- #3799: Update devDependencies to fix many npm vulnerabilities (@XhmikosR)
Two more regressions fixed:
- #3768: Test file paths no longer dropped from
mocha.opts
(@boneskull) - #3767:
--require
does not break on module names that look like certainnode
flags (@boneskull)
The obligatory round of post-major-release bugfixes.
These issues were regressions.
- #3754: Mocha again finds
test.js
when 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-
undefined
value from adescribe
callback is no longer considered deprecated (@boneskull)
- #3738: Upgrade to
@mocha/docdash@2
(@tendonstrength) - #3751: Use preferred names for example config files (@Szauka)
- #3726: Add ability to unload files from
require
cache (@plroebuck)
- #3737: Fix falsy values from options globals (@plroebuck)
- #3707: Fix encapsulation issues for
Suite#_onlyTests
andSuite#_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
lookupFiles
andfiles
(@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-options
did not support comma-separated key/value pairs (@boneskull)
- #3677: Add error objects for createUnsupportedError and createInvalidExceptionError (@boneskull)
- #3733: Removed unnecessary processing in post-processing hook (@wanseob)
- #3730: Update nyc to latest version (@coreyfarrell)
- #3648, #3680: Fixes to support latest versions of unexpected and unexpected-sinon (@sunesimonsen)
- #3638: Add meta tag to site (@MartijnCuppens)
- #3653: Fix parts of test suite failing to run on Windows (@boneskull)
- Fix missing
mocharc.json
in published package (@boneskull)
Documentation for this release can be found at next.mochajs.org!
Welcome @plroebuck, @craigtaub, & @markowsiak to the team!
- #3149: Drop Node.js v4.x support (@outsideris)
- #3556: Changes to command-line options (@boneskull):
--grep
and--fgrep
are now mutually exclusive; attempting to use both will cause Mocha to fail instead of simply ignoring--grep
--compilers
is no longer supported; attempting to use will cause Mocha to fail with a link to more information-d
is no longer an alias for--debug
;-d
is currently ignored- #3275:
--watch-extensions
no longer impliesjs
; it must be explicitly added (@TheDancingCode)
- #2908:
tap
reporter emits error messages (@chrmod) - #2819: When conditionally skipping in a
before
hook, subsequentbefore
hooks and tests in nested suites are now skipped (@bannmoore) - #627: Emit filepath in "timeout exceeded" exceptions where applicable (@boneskull)
- #3556:
lib/template.html
has moved tolib/browser/template.html
(@boneskull) - #2576: An exception is now thrown if Mocha fails to parse or find a
mocha.opts
at a user-specified path (@plroebuck) - #3458: Instantiating a
Base
-extending reporter without aRunner
parameter will throw an exception (@craigtaub) - #3125: For consumers of Mocha's programmatic API, all exceptions thrown from Mocha now have a
code
property (and some will have additional metadata). SomeError
messages have changed. Please use thecode
property to checkError
types instead of themessage
property; these descriptions will be localized in the future. (@craigtaub)
These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:
-gc
users should use--gc-global
instead- Consumers of the function exported by
bin/options
should now use theloadMochaOpts
orloadOptions
(preferred) functions exported by thelib/cli/options
module
Regarding the Mocha
class constructor (from lib/mocha
):
- Use property
color: false
instead ofuseColors: false
- Use property
timeout: false
instead 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 introduced in #3556:
-
Mocha now supports "RC" files in JS, JSON, YAML, or
package.json
-based (usingmocha
property) format.mocharc.js
,.mocharc.json
,.mocharc.yaml
or.mocharc.yml
are valid "rc" file names and will be automatically loaded- Use
--config /path/to/rc/file
to specify an explicit path - Use
--package /path/to/package.json
to specify an explicitpackage.json
to read themocha
prop from - Use
--no-config
or--no-package
to 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.json
mocha.opts
- Mocha's own defaults
- Check out these example config files
-
Node/V8 flag support in
mocha
executable:- Support all allowed
node
flags 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.json
properties, ormocha.opts
- Debug-related flags (e.g.,
--inspect
) now imply--no-timeouts
- Use of e.g.,
--debug
will automatically invoke--inspect
if 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
--interfaces
flag -
Mocha
constructor supports all options -
--extension
is now an alias for--watch-extensions
and 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:
tap
reporter is now TAP13-capable (@plroebuck & @mollstam) -
#3535: Mocha's version can now be queried programmatically via public property
Mocha.prototype.version
(@plroebuck) -
#2529:
Runner
now emits aretry
event when tests are retried (reporters can listen for this) (@catdad) -
#2962, #3111: In-browser notification support; warn about missing prereqs when
--growl
supplied (@plroebuck)
- #3356:
--no-timeouts
and--timeout 0
now does what you'd expect (@boneskull) - #3475: Restore
--no-exit
option (@boneskull) - #3570: Long-running tests now respect
SIGINT
(@boneskull) - #2944:
--forbid-only
and--forbid-pending
now "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
--bail
would 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)
- #3525: Improvements to
.github/CONTRIBUTING.md
(@markowsiak) - #3466: Update description of
slow
option (@finfin) - #3405: Remove references to bower installations (@goteamtim)
- #3361: Improvements to
--watch
docs (@benglass) - #3136: Improve docs around globbing and shell expansion (@akrawchyk)
- #2819: Update docs around skips and hooks (@bannmoore)
- Many improvements by @outsideris
- #3557: Use
ms
userland module instead of hand-rolled solution (@gizemkeser) - Many CI fixes and other refactors by @plroebuck
- Test refactors by @outsideris
- #3375: Add support for comments in
mocha.opts
(@plroebuck)
- #3346: Exit correctly from
before
hooks when using--bail
(@outsideris)
- #3330: Use
Buffer.from()
(@harrysarson) - #3295: Remove redundant folder (@DavNej)
- #3356: Refactoring (@plroebuck)
- #3325: Revert change which broke
--watch
(@boneskull)
- #3318: Fix failures in circular objects in JSON reporter (@jeversmann, @boneskull)
- #3323: Publish actual API documentation! (@dfberry, @Munter)
- #3299: Improve docs around exclusive tests (@nicgirault)
- #3302, #3308, #3310, #3315, #3316: Build matrix improvements (more info) (@outsideris, @boneskull)
- #3272: Refactor reporter tests (@jMuzsik)
Welcome @outsideris to the team!
- #3096: Fix
--bail
failing to bail within hooks (@outsideris) - #3184: Don't skip too many suites (using
describe.skip()
) (@outsideris)
- #3133: Improve docs regarding "pending" behavior (@ematicipo)
- #3276, #3274: Fix broken stuff in
CHANGELOG.md
(@tagoro9, @honzajavorek)
- #3208: Improve test coverage for AMD users (@outsideris)
- #3267: Remove vestiges of PhantomJS from CI (@anishkny)
- #2952: Fix a debug message (@boneskull)
- #3265: Fixes regression in "watch" functionality introduced in v5.0.2 (@outsideris)
This patch features a fix to address a potential "low severity" ReDoS vulnerability in the diff package (a dependency of Mocha).
- #3011: Expose
generateDiff()
inBase
reporter (@harrysarson)
This release fixes a class of tests which report as false positives. Certain tests will now break, though they would have previously been reported as passing. Details below. Sorry for the inconvenience!
-
#3226: Do not swallow errors that are thrown asynchronously from passing tests (@boneskull). Example:
```js it('should actually fail, sorry!', function (done) { // passing assertion assert(true === true);
// test complete & is marked as passing done();
// ...but something evil lurks within setTimeout(() => { throw new Error('chaos!'); }, 100); }); ```
Previously to this version, Mocha would have silently swallowed the
chaos!
exception, and you wouldn't know. Well, now you know. Mocha cannot recover from this gracefully, so it will exit with a nonzero code.Maintainers of external reporters: If a test of this class is encountered, the
Runner
instance will emit theend
event twice; you may need to change your reporter to userunner.once('end')
intead ofrunner.on('end')
. -
#3093: Fix stack trace reformatting problem (@outsideris)
- #3248: Update
browser-stdout
to v1.3.1 (@honzajavorek)
...your garden-variety patch release.
Special thanks to Wallaby.js for their continued support! ❤️
- #1838:
--delay
now works with.only()
(@silviom) - #3119: Plug memory leak present in v8 (@boneskull)
- #3132, #3098: Update
--glob
docs (@outsideris) - #3212: Update Wallaby.js-related docs (@ArtemGovorov)
- #3205: Remove outdated cruft (@boneskull)
- #3224: Add proper Wallaby.js config (@ArtemGovorov)
- #3230: Update copyright year (@josephlin55555)
Mocha starts off 2018 right by again dropping support for unmaintained rubbish.
Welcome @vkarpov15 to the team!
- #3148: Drop support for IE9 and IE10 (@Bamieh) Practically speaking, only code which consumes (through bundling or otherwise) the userland buffer module should be affected. However, Mocha will no longer test against these browsers, nor apply fixes for them.
- #3181: Add useful new
--file
command line argument (documentation) (@hswolff)
- #3187: Fix inaccurate test duration reporting (@FND)
- #3202: Fix bad markup in HTML reporter (@DanielRuf)
- #3137: Add missing
--no-timeouts
docs (@dfberry) - #3134: Improve
done()
callback docs (@maraisr) - #3135: Fix cross-references (@vkarpov15)
- #3163: Fix tpyos (@tbroadley)
- #3177: Tweak
README.md
organization (@xxczaki) - Misc updates (@boneskull)
- #3118: Move TextMate Integration to its own repo (@Bamieh)
- #3185: Add Node.js v9 to build matrix; remove v7 (@xxczaki)
- #3172: Markdown linting (@boneskull)
- Test & Netlify updates (@Munter, @boneskull)
This is mainly a "housekeeping" release.
Welcome @Bamieh and @xxczaki to the team!
- #2661:
progress
reporter now accepts reporter options (@canoztokmak) - #3142:
xit
inbdd
interface now properly returns itsTest
object (@Bamieh) - #3075: Diffs now computed eagerly to avoid misinformation when reported (@abrady0)
- #2745:
--help
will now help you even if you have amocha.opts
(@Zarel)
- #2514: The
--no-diff
flag will completely disable diff output (@CapacitorSet) - #3058: All "setters" in Mocha's API are now also "getters" if called without arguments (@makepanic)
- #3170: Optimization and site speed improvements (@Munter)
- #2987: Moved the old site repo into the main repo under
docs/
(@boneskull) - #2896: Add maintainer guide (@boneskull)
- Various fixes and updates (@xxczaki, @maty21, @leedm777)
- Test improvements and fixes (@eugenet8k, @ngeor, @38elements, @Gerhut, @ScottFreeCode, @boneskull)
- Refactoring and cruft excision (@38elements, @Bamieh, @finnigantime, @boneskull)
- #3051: Upgrade Growl to v1.10.3 to fix its peer dep problems (@dpogue)
You might want to read this before filing a new bug! 😝
For more info, please read this article.
- #3016: Drop support for unmaintained versions of Node.js (@boneskull):
- 0.10.x
- 0.11.x
- 0.12.x
- iojs (any)
- 5.x.x
- #2979: Drop support for non-ES5-compliant browsers (@boneskull):
- IE7
- IE8
- PhantomJS 1.x
- #2615: Drop Bower support; old versions (3.x, etc.) will remain available (@ScottFreeCode, @boneskull)
- #2879: By default, Mocha will no longer force the process to exit once all tests complete. This means any test code (or code under test) which would normally prevent
node
from exiting will do so when run in Mocha. Supply the--exit
flag to revert to pre-v4.0.0 behavior (@ScottFreeCode, @boneskull)
- #2095: Remove
stdout:
prefix from browser reporter logs (@skeggse) - #2295: Add separator in "unified diff" output (@olsonpm)
- #2686: Print failure message when
--forbid-pending
or--forbid-only
is specified (@ScottFreeCode) - #2814: Indent contexts for better readability when reporting failures (@charlierudolph)
- #2493: The
--compilers
command-line option is now soft-deprecated and will emit a warning onSTDERR
. Read this for more info and workarounds (@ScottFreeCode, @boneskull)
- #2890: Speed up build by (re-)consolidating SauceLabs tests (@boneskull)
- #3001: Fix AMD-related failures first appearing in v3.5.1 (@boneskull)
- 📣 Mocha is now sponsoring PDXNode! If you're in the Portland area, come check out the monthly talks and hack nights!
- #2997: Fix missing
xit
export for "require" interface (@solodynamo) - #2957: Fix unicode character handling in XUnit reporter failures (@jkrems)
- #2986: Add issue and PR templates (@kungapal)
- #2918: Drop bash dependency for glob-related tests (@ScottFreeCode)
- #2922: Improve
--compilers
coverage (@ScottFreeCode) - #2981: Fix tpyos and spelling errors (@jsoref)
- Mocha now has a code of conduct (thanks @kungapal!).
- Old issues and PRs are now being marked "stale" by Probot's "Stale" plugin. If an issue is marked as such, and you would like to see it remain open, simply add a new comment to the ticket or PR.
- WARNING: Support for non-ES5-compliant environments will be dropped starting with version 4.0.0 of Mocha!
- #2860: Address CVE-2015-8315 via upgrade of debug (@boneskull)
- #2696: Add
--forbid-only
and--forbid-pending
flags. Use these in CI or hooks to ensure tests aren't accidentally being skipped! (@charlierudolph) - #2813: Support Node.js 8's
--napi-modules
flag (@jupp0r)
- Various CI-and-test-related fixes and improvements (@boneskull, @dasilvacontin, @PopradiArpad, @Munter, @ScottFreeCode)
- "Officially" support Node.js 8 (@elergy)
- #2802: Remove call to deprecated
os.tmpDir
(@makepanic) - #2820: Eagerly set
process.exitCode
(@chrisleck)
Fixed a publishing mishap with git's autocrlf settings.
Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.
This week's highlights:
allowUncaught
added to commandline as--allow-uncaught
(and bugfixed)- warning-related Node flags
- #2793, #2697: add --allowUncaught to Node.js (@lrowe)
- #2733: Add
--no-warnings
and--trace-warnings
flags (@sonicdoe)
- #2778: Add license report and scan status (@xizhao)
- #2794: no special case for macOS running Karma locally (@boneskull)
- #2795: reverts use of semistandard directly (#2648) (@boneskull)
Thanks to all our contributors, maintainers, sponsors, and users! ❤️
As highlights:
- We've got coverage now!
- Testing is looking less flaky \o/.
- No more nitpicking about "mocha.js" build on PRs.
- #2659: Adds support for loading reporter from an absolute or relative path (@sul4bh)
- #2769: Support
--inspect-brk
on command-line (@igwejk)
- #2672: Add coverage for node tests (@c089, @Munter)
- #2680: Increase tests coverage for base reporter (@epallerols)
- #2690: Increase tests coverage for doc reporter (@craigtaub)
- #2701: Increase tests coverage for landing, min, tap and list reporters (@craigtaub)
- #2691: Increase tests coverage for spec + dot reporters (@craigtaub)
- #2698: Increase tests coverage for xunit reporter (@craigtaub)
- #2699: Increase tests coverage for json-stream, markdown and progress reporters (@craigtaub)
- #2703: Cover .some() function in utils.js with tests (@seppevs)
- #2773: Add tests for loading reporters w/ relative/absolute paths (@sul4bh)
- Remove bin/.eslintrc; ensure execs are linted (@boneskull)
- #2542: Expand CONTRIBUTING.md (@boneskull)
- #2660: Double timeouts on integration tests (@Munter)
- #2653: Update copyright year ([@Scottkao85], @Munter)
- #2621: Update dependencies to enable Greenkeeper (@boneskull, @greenkeeper)
- #2625: Use trusty container in travis-ci; use "artifacts" addon (@boneskull)
- #2670: doc(CONTRIBUTING): fix link to org members (@coderbyheart)
- Add Mocha propaganda to README.md (@boneskull)
- #2470: Avoid test flake in "delay" test (@boneskull)
- #2675: Limit browser concurrency on sauce (@boneskull)
- #2669: Use temporary test-only build of mocha.js for browsers tests (@Munter)
- Fix "projects" link in README.md (@boneskull)
- #2678: Chore(Saucelabs): test on IE9, IE10 and IE11 (@coderbyheart)
- #2648: Use
semistandard
directly (@kt3k) - #2727: Make the build reproducible (@lamby)
Mocha is proud to have joined the JS Foundation. For more information, read the announcement.
Under the foundation, all contributors to Mocha must sign the JS Foundation CLA before their code can be merged. When sending a PR--if you have not already signed the CLA--a friendly bot will ask you to do so.
Mocha remains licensed under the MIT license.
- #2535: Fix crash when
--watch
encounters broken symlinks (@villesau) - #2593: Fix (old) regression; incorrect symbol shown in
list
reporter (@Aldaviva) - #2584: Fix potential error when running XUnit reporter (@vobujs)
- #2294: Improve timeout error messaging (@jeversmann, @boneskull)
- #2520: Add info about
--inspect
flag to CLI help (@ughitsaaron)
- #2570: Use karma-mocha proper (@boneskull)
- Licenses updated to reflect new copyright, add link to license and browser matrix to
README.md
(@boneskull, @ScottFreeCode, @dasilvacontin)
Thanks to all our contributors, sponsors and backers! Keep on the lookout for a public roadmap and new contribution guide coming soon.
- #2528: Recovery gracefully if an
Error
'sstack
property isn't writable (@boneskull)
- #1417: Don't report
done()
was called multiple times when it wasn't (@frankleonrose)
- #2490: Lint with semistandard config (@makepanic)
- #2525: Lint all
.js
files (@boneskull) - #2524: Provide workaround for developers unable to run browser tests on macOS Sierra (@boneskull)
- #2357: Support
--inspect
on command-line (@simov) - #2194: Human-friendly error if no files are matched on command-line (@Munter)
- #1744: Human-friendly error if a Suite has no callback (BDD/TDD only) (@anton)
- #2488: Fix case in which variables beginning with lowercase "D" may not have been reported properly as global leaks (@JustATrick) 😆
- #2465: Always halt execution in async function when
this.skip()
is called (@boneskull) - #2445: Exits with expected code 130 when
SIGINT
encountered; exit code can no longer rollover at 256 (@Munter) - #2315: Fix uncaught TypeError thrown from callback stack (@1999)
- Fix broken
only()
/skip()
in IE7/IE8 (@boneskull) - #2502: Fix broken stack trace filter on Node.js under Windows (@boneskull)
- #2496: Fix diff output for objects instantiated with
String
constructor (more) (@boneskull)
- #2424: Fix error loading Mocha via Require.js (@boneskull)
- #2417: Fix execution of deeply nested
describe.only()
suites (@not-an-aardvark) - Remove references to
json-cov
andhtml-cov
reporters in CLI (@boneskull)
- #2406: Restore execution of nested
describe.only()
suites (@not-an-aardvark)
-
⚠️ Due to the increasing difficulty of applying security patches made within its dependency tree, as well as looming incompatibilities with Node.js v7.0, Mocha no longer supports Node.js v0.8. -
⚠️ Mocha may no longer be installed by versions ofnpm
less than1.4.0
. Previously, this requirement only affected Mocha's development dependencies. In short, this allows Mocha to depend on packages which have dependencies fixed to major versions (^
). -
.only()
is no longer "fuzzy", can be used multiple times, and generally just works like you think it should. 😂 -
To avoid common bugs, when a test injects a callback function (suggesting asynchronous execution), calls it, and returns a
Promise
, Mocha will now throw an exception:```js const assert = require('assert');
it('should complete this test', function (done) { return new Promise(function (resolve) { assert.ok(true); resolve(); }) .then(done); }); ```
The above test will fail with
Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.
. -
When a test timeout value greater than
2147483648
is specified in any context (--timeout
,mocha.setup()
, per-suite, per-test, etc.), the timeout will be disabled and the test(s) will be allowed to run indefinitely. This is equivalent to specifying a timeout value of0
. See MDN for reasoning. -
The
dot
reporter now uses more visually distinctive characters when indicating "pending" and "failed" tests. -
Mocha no longer supports component.
-
The long-forsaken
HTMLCov
andJSONCov
reporters--and any relationship to the "node-jscoverage" project--have been removed. -
spec
reporter now omits leading carriage returns (\r
) in non-TTY environment.
- #808: Allow regular-expression-like strings in
--grep
and browser'sgrep
querystring; enables flags such asi
for case-insensitive matches andu
for unicode. (@a8m) - #2000: Use distinctive characters in
dot
reporter;,
will denote a "pending" test and!
will denote a "failing" test. (@elliottcable) - #1632: Throw a useful exception when a suite or test lacks a title. (@a8m)
- #1481: Better
.only()
behavior. (@a8m) - #2334: Allow
this.skip()
in async tests and hooks. (@boneskull) - #1320: Throw a useful exception when test resolution method is overspecified. (@jugglinmike)
- #2364: Support
--preserve-symlinks
. (@rosswarren)
- #2259: Restore ES3 compatibility. Specifically, support an environment lacking
Date.prototype.toISOString()
,JSON
, or has a non-standard implementation ofJSON
. (@ndhoule, @boneskull) - #2286: Fix
after()
failing to execute if test skipped usingthis.skip()
inbeforeEach()
; no longer marks the entire suite as "pending". (@dasilvacontin, @boneskull) - #2208: Fix function name display in
markdown
andhtml
(browser) reporters. (@ScottFreeCode) - #2299: Fix progress bar in
html
(browser) reporter. (@AviVahl) - #2307: Fix
doc
reporter crashing when test fails. (@jleyba) - #2323: Ensure browser entry point (
browser-entry.js
) is published to npm (for use with bundlers). (@boneskull) - #2310: Ensure custom reporter with an absolute path works in Windows. (@silentcloud)
- #2311: Fix problem wherein calling
this.slow()
without a value would blast any previously set value. (@boneskull) - #1813: Ensure Mocha's own test suite will run in Windows. (@tswaters, @TimothyGu, @boneskull)
- #2317: Ensure all interfaces are displayed in
--help
on CLI. (@ScottFreeCode) - #1644: Don't exhibit undefined behavior when calling
this.timeout()
with very large values (@callumacrae, @boneskull) - #2361: Don't truncate name of thrown anonymous exception. (@boneskull)
- #2367: Fix invalid CSS. (@bensontrent)
- #2401: Remove carriage return before each test line in spec reporter. (@Munter)
- Upgrade production dependencies to address security advisories (and because now we can):
glob
,commander
,escape-string-regexp
, andsupports-color
. (@boneskull, @RobLoach) - Add Windows to CI. (@boneskull, @TimothyGu)
- Ensure appropriate
engines
field inpackage.json
. (@shinnn, @boneskull) - #2348: Upgrade ESLint to v2 (@anthony-redfox)
We ❤️ our backers and sponsors!
- #2112 - Fix HTML reporter regression causing duplicate error output (@danielstjules via
6d24063
) - #2119 - Make HTML reporter failure/passed links preventDefault to avoid SPA's hash navigation (@jimenglish81 via
9e93efc
)
- #2178 - Avoid double and triple xUnit XML escaping (@graingert via
49b5ff1
)
- Fix to-iso-string dependency (@boneskull via
bd9450b
)
Thanks @entertainyou, @SimenB, @just-paja for the heads-up.
This has been awhile coming! We needed to feel confident that the next release wouldn't break browser compatibility (e.g. the last few patch releases).
We now run unit tests against PhantomJS v1.x and an assortment of browsers on SauceLabs, including:
- Internet Explorer v8.0
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Microsoft Edge (latest)
To accomplish this, we now run Mocha's unit tests (and a handful of integration tests) via Karma and a modified karma-mocha. Along the way, we had to solve issue #880 (apologies to @mderijcke and @sukima who had PRs addressing this), as well as replace most usages of should with expect.js for IE8.
Going forward, when sending PRs, your code will only run against PhantomJS v1.x (and not hit SauceLabs) because security.
Node.js 6.x "just worked" before, but now it's in the CI matrix, so it's "officially" supported. Mocha still retains support for Node.js 0.8.x.
You'll see mostly bug fixes below, but also a couple features--as such, it's a "minor" release.
Thanks to everyone who contributed, and our fabulous sponsors and backers!
- #2079 - Add browser checks to CI; update browserify to v13.0.0 (@dasilvacontin, @ScottFreeCode, @boneskull via
c04c1d7
,0b1e9b3
,0dde0fa
,f8a3d86
,9e8cbaa
) - #880 - Make Mocha browserifyable (@boneskull via
524862b
) - #2121 - Update glob to v3.2.11 (@astorije via
7920fc4
) - #2126 - Fix dupe error messages in stack trace filter (@Turbo87 via
4301caa
) - #2109 - Fix certain diffs when objects cannot be coerced into primitives (@joshlory via
61fbb7f
) - #1827 - Fix TWBS/
mocha.css
collisions (@irnc via0543798
) - #1760, #1936 - Fix
this.skip()
in HTML reporter (@mislav viacb4248b
) - #2115 - Fix exceptions thrown from hooks in HTML reporter (@danielstjules via
e290bc0
) - #2089 - Handle Symbol values in
util.stringify()
(@ryym viaea61d05
) - #2097 - Fix diff for objects overriding
Object.prototype.hasOwnProperty
(@mantoni viab20fdfe
) - #2101 - Properly handle non-string "messages" thrown from assertion libraries (@jkimbo via
9c41051
) - #2124 - Update growl (@benjamine via
9ae6a85
) - #2162, #2205 - JSDoc fixes (@OlegTsyba via
8031f20
, @ScottFreeCode viaf83b1d9
) - #2132 - Remove Growl-related cruft (@julienw via
00d6469
) - #2172 - Add OpenCollective badge, sponsors & backers (@xdamman, @boneskull via
caee94f
) - #1841 - Add new logo, banner assets (@dasilvacontin via
00fd0e1
) - #2214 - Update
README.md
header (@dasilvacontin viac0f9be2
) - #2236 - Better checks for Node.js v0.8 compatibility in CI (@dasilvacontin via
ba5637d
) - #2239 - Add Node.js v6.x to CI matrix (@boneskull via
3904da4
)
- #2080, #2078, #2072, #2073, #1200 - Revert changes to console colors in changeset 1192914 and subsequent related changes thereafter. Restores compatibility with IE8 & PhantomJS. See also mantoni/mochify.js#129 and openlayers/ol3#4746 (@boneskull)
- #2082 - Fix several test assertions (@mislav)
- #2080 - Fix broken RequireJS compatibility (@boneskull)
- #2078 - Fix broken IE8 (@boneskull)
- #2053 - Fix web worker compatibility (@mislav)
- #2072 - Fix Windows color output (@thedark1337)
- #2073 - Fix colors in
progress
andlanding
reporters (@gyandeeps)
- #2067 - Fix HTML/doc reporter regressions (@danielstjules)
- #1945 - Correctly skip tests when skipping in suite's before() (@ryanshawty)
- #2056 - chore(license): update license year to 2016 (@pra85)
- #2048 - Fix
this.skip
from spec with HTML reporter (@mislav) - #2033 - Update tests for newer versions of should.js (@tomhughes)
- #2037 - Fix for memory leak caused by referenced to deferred test (@bd82)
- #2038 - Also run Travis-CI on node.js 4 & 5 (@bd82)
- #2028 - Remove reference to test before afterAll hook runs (@stonelgh)
- Bump mkdirp to 0.5.1 to support strict mode (@danielstjules)
- #1977 - safely stringify PhantomJS undefined value (@ahamid)
- Add the ability to retry tests ([@@longlho])
- #1982 - Enable --log-timer-events option @Alaneor
- Fix #1980: Load mocha.opts from bin/mocha and bin/_mocha (@danielstjules)
- #1976 - Simplify function call (@iclanzan)
- #1963 - Add support --perf-basic-prof (@robraux)
- #1981 - Fix HTML reporter handling of done and exceptions (@Standard8)
- #1993 - propagate "file" property for "exports" interface (@segrey)
- #1999 - Add support for strict mode (@tmont)
- #2005 - XUnit Reporter Writes to stdout, falls back to console.log (@jonnyreeves)
- #2021 - Fix non ES5 compliant regexp (@zetaben)
- [#1965] - Don't double install BDD UI (@cowboyd)
- #1995 - Make sure the xunit output dir exists before writing to it (@ianwremmel)
- Use chalk for the base reporter colors; closes #1200 (@boneskull)
- Fix requiring custom interfaces (@jgkim)
- #1967 Silence Bluebird js warnings (@krisr)
- Update debug dependency to 2.2.0
- remove duplication of mocha.opts on process.argv
- Fix typo in test/reporters/nyan.js
- #1875 - Fix Markdown reporter exceeds maximum call stack size (@danielstjules)
- #1864 - Fix xunit missing output with --reporter-options output (@danielstjules)
- #1846 - Support all harmony flags (@danielstjules)
- Fix fragile xunit reporter spec (@danielstjules)
- #1669 - Fix catch uncaught errors outside test suite execution (@danielstjules)
- #1868 - Revert jade to support npm < v1.3.7 (@danielstjules)
- #1766 - Don't remove modules/components from stack trace in the browser (@danielstjules)
- #1798 - Fix correctly attribute mutiple done err with hooks (@danielstjules)
- Fix use utils.reduce for IE8 compatibility (@wsw0108)
- Some linting errors fixed by @danielstjules
- Call the inspect() function if message is not set (@kevinburke)
- #1868 - Fix compatibility with older versions of NPM (@boneskull)
- #1812 - Fix: Bail flag causes before() hooks to be run even after a failure ([@aaroncrows])
- #553 - added --allowUncaught option (@amsul)
- #1490 - Allow --async-only to be satisfied by returning a promise (@jlai)
- #1829 - support --max-old-space-size (@gigadude)
- #1811 - upgrade Jade dependency (@outsideris)
- #1769 - Fix async hook error handling (@ajaykodali)
- #1230 - More descriptive beforeEach/afterEach messages (@duncanbeevers)
- #1787 - Scope loading behaviour instead of using early return (@aryeguy)
- #1789 - Fix: html-runner crashing (@sunesimonsen)
- #1749 - Fix maximum call stack error on large amount of tests (@tinganho)
- #1230 - Decorate failed hook titles with test title (@duncanbeevers)
- #1260 - Build using Browserify (@ndhoule)
- #1728 - Don't use
__proto__
(@ndhoule) - #1781 - Fix hook error tests (@glenjamin)
- #1754 - Allow boolean --reporter-options (@papandreou)
- #1766 - Fix overly aggressive stack suppression (@moll)
- #1752 - Avoid potential infinite loop (@gsilk)
- #1761 - Fix problems running under PhantomJS (@chromakode)
- #1700 - Fix more problems running under PhantomJS (@jbnicolai)
- #1774 - Support escaped spaces in CLI options (@adamgruber)
- #1687 - Fix HTML reporter links with special chars (@benvinegar)
- #1359 - Adopt code style and enforce it using ESLint (@ndhoule w/ assist from @jbnicolai & @boneskull)
- various refactors (@jbnicolai)
- #1758 - Add cross-frame compatible Error checking (@outdooricon)
- #1741 - Remove moot
version
property from bower.json (@kkirsche) - #1739 - Improve
HISTORY.md
(@rstacruz) - #1730 - Support more io.js flags (@ryedog)
- #1349 - Allow HTML in HTML reporter errors (@papandreou / @sunesimonsen)
- #1572 - Prevent default browser behavior for failure/pass links (@jschilli)
- #1630 - Support underscored harmony flags (@dominicbarnes)
- #1718 - Support more harmony flags (@slyg)
- #1689 - Add stack to JSON-stream reporter (@jonathandelgado)
- #1654 - Fix
ReferenceError
"location is not defined" (@jakemmarsh)
- #1699 - Upgrade jsdiff to v1.4.0 (@nylen)
- #1648 - fix diff background colors in the console (@nylen)
- #1327 - fix tests running twice, a regression issue. (#1686, @danielstjules)
- #1675 - add integration tests (@danielstjules)
- #1682 - use a valid SPDX license identifier in package.json (@kemitchell)
- #1660 - fix assertion of invalid dates (#1661, @a8m)
- #1241 - fix issue with multiline diffs appearing as single line (#1655, @a8m)
- Load mocha.opts in _mocha for now (close #1645)
- fix(reporter/base): string diff - issue #1241
- fix(reporter/base): string diff - issue #1241
- fix(reporter/base): don't show diffs for errors without expectation
- fix(reporter/base): don't assume error message is first line of stack
- improve: dry up reporter/base test
- fix(reporter/base): explicitly ignore showDiff #1614
- Add iojs to travis build
- Pass
--allow-natives-syntax
flag to node. - Support --harmony_classes flag for io.js
- Fix 1556: Update utils.clean to handle newlines in func declarations
- Fix 1606: fix err handling in IE <= 8 and non-ES5 browsers
- Fix 1585: make _mocha executable again
- chore(package.json): add a8m as a contributor
- Fixed broken link on html-cov reporter
- support --es_staging flag
- fix issue where menu overlaps content.
- update contributors in package.json
- Remove trailing whitespace from reporter output
- Remove contributors list from readme
- log third-party reporter errors
- [Fix] Exclude not own properties when looping on options
- fix: support node args in mocha.opts (close #1573)
- fix(reporter/base): string diff - issue #1241
- Fix passing of args intended for node/iojs.
- Update mocha.js
- Add --fgrep. Use grep for RegExp, fgrep for str
- Ignore async global errors after spec resolution
- Fixing errors that prevent mocha.js from loading in the browser - fixes #1558
- fix(utils): issue #1558 + make
- add ability to delay root suite; closes #362, closes #1124
- fix insanity in http tests
- update travis: add node 0.12, add gitter, remove slack
- building
- resolve #1548: ensure the environment's "node" executable is used
- reporters/base: use supports-color to detect colorable term
- travis: use docker containers
- small fix: commander option for --expose-gc
- Ignore asynchronous errors after global failure
- Improve error output when a test fails with a non-error
- updated travis badge, uses svg instead of img
- Allow skip from test context for #332
- [JSHINT] Unnecessary semicolon fixed in bin/_mocha
- Added a reminder about the done() callback to test timeout error messages
- fixes #1496, in Mocha.run(fn), check if fn exists before executing it, added tests too
- Add Harmony Proxy flag for iojs
- test(utils|ms|*): test existing units
- add support for some iojs flags
- fix(utils.stringify): issue #1229, diff viewer
- Remove slack link
- Prevent multiple 'grep=' querystring params in html reporter
- Use grep as regexp (close #1381)
- utils.stringify should handle objects without an Object prototype
- in runnable test, comparing to undefined error's message rather than a literal
- Fix test running output truncation on async STDIO
- amended for deprecated customFds option in child_process
- showDiff: don’t stringify strings
- Clean up unused module dependencies.
- Filter zero-length strings from mocha.opts
- only write to stdout in reporters
- Revert "only write to stdout in reporters"
- Print colored output only to a tty
- update summary in README.md
- rename Readme.md/History.md to README.md/HISTORY.md because neurotic
- add .mailmap to fix "git shortlog" or "git summary" output
- fixes #1461: nyan-reporter now respects Base.useColors, fixed bug where Base.color would not return a string when str wasn't a string.
- Use existing test URL builder in failed replay links
- modify .travis.yml: use travis_retry; closes #1449
- fix -t 0 behavior; closes #1446
- fix tests (whoops)
- improve diff behavior
- Preserve pathname when linking to individual tests
- Fix test
- Tiny typo in comments fixed
- after hooks now being called on failed tests when using bail, fixes #1093
- fix throwing undefined/null now makes tests fail, fixes #1395
- compiler extensions are added as watched extensions, removed non-standard extensions from watch regex, resolves #1221
- prefix/namespace for suite titles in markdown reporter, fixes #554
- fix more bad markdown in CONTRIBUTING.md
- fix bad markdown in CONTRIBUTING.md
- add setImmediate/clearImmediate to globals; closes #1435
- Fix buffer diffs (closes #1132, closes #1433)
- add a CONTRIBUTING.md. closes #882
- fix intermittent build failures (maybe). closes #1407
- add Slack notification to .travis.yml
- Fix slack link
- Add slack room to readme
- Update maintainers
- update maintainers and contributors
- resolves #1393: kill children with more effort on SIGINT
- xunit reporter support for optionally writing to a file
- if a reporter has a .done method, call it before exiting
- add support for reporter options
- only write to stdout in reporters
- remove: support for node 0.6.x, 0.4.x
- fix: landing reporter with non ansi characters (#211)
- fix: html reporter - preserve query params when navigating to suites/tests (#1358)
- fix: json stream reporter add error message to failed test
- fix: fixes for visionmedia -> mochajs
- fix: use stdio, fixes node deprecation warnings (#1391)
- fix: build for NodeJS v0.6.x
- fix: do not attempt to highlight syntax when non-HTML reporter is used
- update: escape-string-regexp to 1.0.2.
- fix: botched indentation in canonicalize()
- fix: .gitignore: ignore .patch and .diff files
- fix: changed 'Catched' to 'Caught' in uncaught exception error handler messages
- add:
pending
field for json reporter - fix: Runner.prototype.uncaught: don't double-end runnables that already have a state.
- fix: --recursive, broken by
f0facd2
- update: replaces escapeRegexp with the escape-string-regexp package.
- update: commander to 2.3.0.
- update: diff to 1.0.8.
- fix: ability to disable syntax highlighting (#1329)
- fix: added empty object to errorJSON() call to catch when no error is present
- fix: never time out after calling enableTimeouts(false)
- fix: timeout(0) will work at suite level (#1300)
- Fix for --watch+only() issue (#888 )
- fix: respect err.showDiff, add Base reporter test (#810)
- fix: disabling timeouts with this.timeout(0) (#1301)
- add: --no-timeouts option (#1262, #1268)
- add: --*- deprecation node flags (#1217)
- add: --watch-extensions argument (#1247)
- change: spec reporter is default (#1228)
- fix: diff output showing incorrect +/- (#1182)
- fix: diffs of circular structures (#1179)
- fix: re-render the progress bar when progress has changed only (#1151)
- fix support for environments with global and window (#1159)
- fix: reverting to previously defined onerror handler (#1178)
- fix: stringify non error objects passed to done() (#1270)
- fix: using local ui, reporters (#1267)
- fix: cleaning es6 arrows (#1176)
- fix: don't include attrs in failure tag for xunit (#1244)
- fix: fail tests that return a promise if promise is rejected w/o a reason (#1224)
- fix: showing failed tests in doc reporter (#1117)
- fix: dot reporter dots being off (#1204)
- fix: catch empty throws (#1219)
- fix: honoring timeout for sync operations (#1242)
- update: growl to 1.8.0
- update: should dev dependency to ~4.0.0 (#1231)
- add: filenames to suite objects (#1222)
- add: browser script option to package.json
- add: export file in Mocha.Test objects (#1174)
- add: add docs for wrapped node flags
- fix: mocha.run() to return error status in browser (#1216)
- fix: clean() to show failure details (#1205)
- fix: regex that generates html for new keyword (#1201)
- fix: sibling suites have inherited but separate contexts (#1164)
- fix: html runner was prevented from using #mocha as the default root el (#1162)
- fix: named before/after hooks in bdd, tdd, qunit interfaces (#1161)
- fix: expected messages in should.js (should.js#168)
- fix: expect errno global in node versions < v0.9.11 (#1111)
- fix: unreliable checkGlobals optimization (#1110)
- add: able to require globals (describe, it, etc.) through mocha (#1077)
- fix: abort previous run on --watch change (#1100)
- fix: reset context for each --watch triggered run (#1099)
- fix: error when cli can't resolve path or pattern (#799)
- fix: canonicalize objects before stringifying and diffing them (#1079)
- fix: make CR call behave like carriage return for non tty (#1087)
- fix: couple issues with ie 8 (#1082, #1081)
- fix: issue running the xunit reporter in browsers (#1068)
- fix: issue with firefox < 3.5 (#725)
- fix: recompiled for missed changes from the last release
- add: Runnable.globals(arr) for per test global whitelist (#1046)
- add: mocha.throwError(err) for assertion libs to call (#985)
- remove: --watch's spinner (#806)
- fix: duplicate test output for multi-line specs in spec reporter (#1006)
- fix: gracefully exit on SIGINT (#1063)
- fix expose the specified ui only in the browser (#984)
- fix: ensure process exit code is preserved when using --no-exit (#1059)
- fix: return true from window.onerror handler (#868)
- fix: xunit reporter to use process.stdout.write (#1068)
- fix: utils.clean(str) indentation (#761)
- fix: xunit reporter returning test duration a NaN (#1039)
- fix: recompiled for missed changes from the last release
- add:
--no-exit
to preventprocess.exit()
(#1018) - fix: using inline diffs (#1044)
- fix: show pending test details in xunit reporter (#1051)
- fix: faster global leak detection (#1024)
- fix: yui compression (#1035)
- fix: wrapping long lines in test results (#1030, #1031)
- fix: handle errors in hooks (#1043)
- add: unified diff (#862)
- add: set MOCHA_COLORS env var to use colors (#965)
- add: able to override tests links in html reporters (#776)
- remove: teamcity reporter (#954)
- update: commander dependency to 2.0.0 (#1010)
- fix: mocha --ui will try to require the ui if not built in, as --reporter does (#1022)
- fix: send cursor commands only if isatty (#184, #1003)
- fix: include assertion message in base reporter (#993, #991)
- fix: consistent return of it, it.only, and describe, describe.only (#840)
- add: sort test files with --sort (#813)
- update: diff dependency to 1.0.7
- update: glob dependency to 3.2.3 (#927)
- fix: diffs show whitespace differences (#976)
- fix: improve global leaks (#783)
- fix: firefox window.getInterface leak
- fix: accessing iframe via window[iframeIndex] leak
- fix: faster global leak checking
- fix: reporter pending css selector (#970)
- remove test.js from .gitignore
- update included version of ms.js
- add: prevent diffs for differing types. Closes #900
- add
Mocha.process
hack for phantomjs - fix: use compilers with requires
- fix regexps in diffs. Closes #890
- fix xunit NaN on failure. Closes #894
- fix: strip tab indentation in
clean
utility method - fix: textmate bundle installation
- add --prof support
- add --harmony support
- add --harmony-generators support
- add "Uncaught " prefix to uncaught exceptions
- add web workers support
- add
suite.skip()
- change to output # of pending / passing even on failures. Closes #872
- fix: prevent hooks from being called if we are bailing
- fix
this.timeout(0)
- add add better globbing support for windows via
glob
module - add support to pass through flags such as --debug-brk=1234. Closes #852
- add test.only, test.skip to qunit interface
- change to always use word-based diffs for now. Closes #733
- change
mocha init
tests.html to index.html - fix
process
global leak in the browser - fix: use resolve() instead of join() for --require
- fix: filterLeaks() condition to not consider indices in global object as leaks
- fix: restrict mocha.css styling to #mocha id
- fix: save timer references to avoid Sinon interfering in the browser build.
- add improved setImmediate implementation
- replace --ignore-leaks with --check-leaks
- change default of ignoreLeaks to true. Closes #791
- remove scrolling for HTML reporter
- fix retina support
- fix tmbundle, restrict to js scope
- add
setImmediate
support for 0.10.x - fix mocha -w spinner on windows
- fix .bail() arity check causing it to default to true
- add Mocha() options bail support
- add
Mocha#bail()
method - add instanceof check back for inheriting from Error
- add component.json
- add diff.js to browser build
- update growl
- fix TAP reporter failures comment :D
- add total number of passes and failures to TAP
- remove .bind() calls. re #680
- fix indexOf. Closes #680
- fix uncaught error support for the browser
- revert uncaught "fix" which breaks node
- fix uncaught errors to expose the original error message
- add
--async-only
support to prevent false positives for missingdone()
- add sorting by filename in code coverage
- add HTML 5 doctype to browser template.
- add play button to html reporter to rerun a single test
- add
this.timeout(ms)
as Suite#timeout(ms). Closes #599 - update growl dependency to 1.6.x
- fix encoding of test-case ?grep. Closes #637
- fix unicode chars on windows
- fix dom globals in Opera/IE. Closes #243
- fix markdown reporter a tags
- fix
this.timeout("5s")
support
- add object diffs when
err.showDiff
is present - add hiding of empty suites when pass/failures are toggled
- add faster
.length
checks tocheckGlobals()
before performing the filter
- add
ms()
to.slow()
and.timeout()
- add
Mocha#checkLeaks()
to re-enable global leak checks - add
this.slow()
option [aheckmann] - add tab, CR, LF to error diffs for now
- add faster
.checkGlobals()
solution [guille] - remove
fn.call()
from reduce util - remove
fn.call()
from filter util - fix forEach. Closes #582
- fix relaying of signals [TooTallNate]
- fix TAP reporter grep number
- add support to multiple
Mocha#globals()
calls, and strings - add
mocha.reporter()
constructor support [jfirebaugh] - add
mocha.timeout()
- move query-string parser to utils.js
- move highlight code to utils.js
- fix third-party reporter support [exogen]
- fix client-side API to match node-side [jfirebaugh]
- fix mocha in iframe [joliss]
- add missing
Markdown
export - fix
Mocha#grep()
, escape regexp strings - fix reference error when
devicePixelRatio
is not defined. Closes #549
- add mkdir -p to
mocha init
. Closes #539 - add
.only()
. Closes #524 - add
.skip()
. Closes #524 - change str.trim() to use utils.trim(). Closes #533
- fix HTML progress indicator retina display
- fix url-encoding of click-to-grep HTML functionality
- fix exports double-execution regression. Closes #531
- add passes/failures toggling to HTML reporter
- add pending state to
xit()
andxdescribe()
[Brian Moore] - add the @charset "UTF-8"; to fix #522 with FireFox. [Jonathan Creamer]
- add border-bottom to #stats links
- add check for runnable in
Runner#uncaught()
. Closes #494 - add 0.4 and 0.6 back to travis.yml
- add
-E, --growl-errors
to growl on failures only - add prefixes to debug() names. Closes #497
- add
Mocha#invert()
to js api - change dot reporter to use sexy unicode dots
- fix error when clicking pending test in HTML reporter
- fix
make tm
- add window scrolling to
HTML
reporter - add v8
--trace-*
option support - add support for custom reports via
--reporter MODULE
- add
--invert
switch to invert--grep
matches - fix export of
Nyan
reporter. Closes #495 - fix escaping of
HTML
suite titles. Closes #486 - fix
done()
called multiple times with an error test - change
--grep
- regexp escape the input
- Added 0.8.0 support
- Added
this.test.error(err)
support to after each hooks. Closes #287 - Added: export top-level suite on global mocha object (mocha.suite). Closes #448
- Fixed
js
code block format error in markdown reporter - Fixed deprecation warning when using
path.existsSync
- Fixed --globals with wildcard
- Fixed chars in nyan when his head moves back
- Remove
--growl
from test/mocha.opts. Closes #289
- Added
nyan
reporter [Atsuya Takagi] - Added
mocha init <path>
to copy client files - Added "specify" synonym for "it" [domenic]
- Added global leak wildcard support [nathanbowser]
- Fixed runner emitter leak. closes #432
- Fixed omission of .js extension. Closes #454
- Added: check each
mocha(1)
arg for directories to walk - Added
--recursive
[tricknotes] - Added
context
for BDD [hokaccha] - Added styling for new clickable titles
- Added clickable suite titles to HTML reporter
- Added warning when strings are thrown as errors
- Changed: green arrows again in HTML reporter styling
- Changed ul/li elements instead of divs for better copy-and-pasting [joliss]
- Fixed issue #325 - add better grep support to js api
- Fixed: save timer references to avoid Sinon interfering.
- Fixed string diff newlines
- Fixed: removed mocha.css target. Closes #401
- Added HTML reporter duration. Closes #47
- Fixed: one postMessage event listener [exogen]
- Fixed: allow --globals to be used multiple times. Closes #100 [brendannee]
- Fixed #158: removes jquery include from browser tests
- Fixed grep. Closes #372 [brendannee]
- Fixed #166 - When grepping don't display the empty suites
- Removed test/browser/style.css. Closes #385
- Fixed
.timeout()
in hooks - Fixed: allow callback for
mocha.run()
in client version - Fixed browser hook error display. Closes #361
- Added js API. Closes #265
- Added: initial run of tests with
--watch
. Closes #345 - Added: mark
location
as a global on the CS. Closes #311 - Added
markdown
reporter (github flavour) - Added: scrolling menu to coverage.html. Closes #335
- Added source line to html report for Safari [Tyson Tate]
- Added "min" reporter, useful for
--watch
[Jakub Nešetřil] - Added support for arbitrary compilers via . Closes #338 [Ian Young]
- Added Teamcity export to lib/reporters/index [Michael Riley]
- Fixed chopping of first char in error reporting. Closes #334 [reported by topfunky]
- Fixed terrible FF / Opera stack traces
- Added lib-cov to .npmignore
- Added reporter to
mocha.run([reporter])
as argument - Added some margin-top to the HTML reporter
- Removed jQuery dependency
- Fixed
--watch
: purge require cache. Closes #266
- Added string diff support for terminal reporters
- Added preliminary test coverage support. Closes #5
- Added
HTMLCov
reporter - Added
JSONCov
reporter [kunklejr] - Added
xdescribe()
andxit()
to the BDD interface. Closes #263 (docs * Changed: make json reporter output pretty json - Fixed node-inspector support, swapped
--debug
fordebug
to match node. Closes #247
- Added
npm docs mocha
support [TooTallNate] - Added a
Context
object used for hook and test-case this. Closes #253 - Fixed
Suite#clone()
.ctx
reference. Closes #262
- Added .coffee
--watch
support. Closes #242 - Added support to
--require
files relative to the CWD. Closes #241 - Added quick n dirty syntax highlighting. Closes #248
- Changed: made HTML progress indicator smaller
- Fixed xunit errors attribute [dhendo]
- Fixed suite count in reporter stats. Closes #222
- Fixed
done()
after timeout error reporting [Phil Sung] - Changed the 0-based errors to 1
- Added support for node 0.7.x
- Fixed absolute path support. Closes #215 [kompiro]
- Fixed
--no-colors
option [Jussi Virtanen] - Fixed Arial CSS typo in the correct file
- Added
-b, --bail
to exit on first exception [guillermo] - Added support for
-gc
/--expose-gc
[TooTallNate] - Added
qunit
-inspired interface - Added MIT LICENSE. Closes #194
- Added:
--watch
all .js in the CWD. Closes #139 - Fixed
self.test
reference in runner. Closes #189 - Fixed double reporting of uncaught exceptions after timeout. Closes #195
- Added test-case context support. Closes #113
- Fixed exit status. Closes #187
- Update commander. Closes #190
- Fixed reporting of uncaught exceptions. Closes #183
- Fixed error message defaulting [indutny]
- Changed mocha(1) from bash to node for windows [Nathan Rajlich]
- Added
XUnit
reporter [FeeFighters/visionmedia] - Added
say(1)
notification support [Maciej Małecki] - Changed: fail when done() is invoked with a non-Error. Closes #171
- Fixed
err.stack
, defaulting to message. Closes #180 - Fixed:
make tm
mkdir -p the dest. Closes #137 - Fixed mocha(1) --help bin name
- Fixed
-d
for--debug
support
- Removed
mocha-debug(1)
, usemocha --debug
- Fixed CWD relative requires
- Fixed growl issue on windows [Raynos]
- Fixed: platform specific line endings [TooTallNate]
- Fixed: escape strings in HTML reporter. Closes #164
- Added support for IE{7,8} [guille]
- Changed: better browser nextTick implementation [guille]
- Added setZeroTimeout timeout for browser (nicer stack traces). Closes #153
- Added "view source" on hover for HTML reporter to make it obvious
- Changed: replace custom growl with growl lib
- Fixed duplicate reporting for HTML reporter. Closes #154
- Fixed silent hook errors in the HTML reporter. Closes #150
- Added: push node_modules directory onto module.paths for relative require Closes #93
- Added teamcity reporter [blindsey]
- Fixed: recover from uncaught exceptions for tests. Closes #94
- Fixed: only emit "test end" for uncaught within test, not hook
- Added support for test-specific timeouts via
this.timeout(0)
. Closes #134 - Added guillermo's client-side EventEmitter. Closes #132
- Added progress indicator to the HTML reporter
- Fixed slow browser tests. Closes #135
- Fixed "suite" color for light terminals
- Fixed
require()
leak spotted by [guillermo]
- Removed suite merging (for now)
- Added support for
window.onerror
[guillermo] - Fixed: clear timeout on uncaught exceptions. Closes #131 [guillermo]
- Added
mocha.css
to PHONY list. - Added
mocha.js
to PHONY list.
- Added: allow
done()
to be called with non-Error - Added: return Runner from
mocha.run()
. Closes #126 - Fixed: run afterEach even on failures. Closes #125
- Fixed clobbering of current runnable. Closes #121
- Fixed hook timeouts. Closes #120
- Fixed uncaught exceptions in hooks
- Fixed weird reporting when
err.message
is not present
- Added
-w, --watch
. Closes #72 - Added
--ignore-leaks
to ignore global leak checking - Added browser
?grep=pattern
support - Added
--globals <names>
to specify accepted globals. Closes #99 - Fixed
mocha-debug(1)
on some systems. Closes #232 - Fixed growl total, use
runner.total
- Added
--globals <names>
to specify accepted globals. Closes #99 - Fixed funky highlighting of messages. Closes #97
- Fixed
mocha-debug(1)
. Closes #232 - Fixed growl total, use runner.total
- Added
suiteSetup
andsuiteTeardown
to TDD interface [David Henderson] - Added growl icons. Closes #84
- Fixed coffee-script support
- Fixed: use
Runner#total
for accurate reporting
- Added
Hook
- Added
Runnable
- Changed:
Test
isRunnable
- Fixed global leak reporting in hooks
- Fixed: > 2 calls to done() only report the error once
- Fixed: clear timer on failure. Closes #80
- Fixed return on immediate async error. Closes #80
- Fixed: make mocha.opts whitespace less picky [kkaefer]
- Added
--interfaces
- Added
--reporters
- Added
-c, --colors
. Closes #69 - Fixed hook timeouts
- Added
-C, --no-colors
to explicitly disable - Added coffee-script support
- Fixed global leak detection due to Safari bind() change
- Fixed: escape html entities in Doc reporter
- Fixed: escape html entities in HTML reporter
- Fixed pending test support for HTML reporter. Closes #66
- Added
--timeout
second shorthand support, ex--timeout 3s
. - Fixed "test end" event for uncaughtExceptions. Closes #61
- Added travis CI support (needs enabling when public)
- Added preliminary browser support
- Added
make mocha.css
target. Closes #45 - Added stack trace to TAP errors. Closes #52
- Renamed tearDown to teardown. Closes #49
- Fixed: cascading hooksc. Closes #30
- Fixed some colors for non-tty
- Fixed errors thrown in sync test-cases due to nextTick
- Fixed Base.window.width... again give precedence to 0.6.x
- Added
doc
reporter. Closes #33 - Added suite merging. Closes #28
- Added TextMate bundle and
make tm
. Closes #20
- Fixed getWindowSize() for 0.4.x
- Added
-s, --slow <ms>
to specify "slow" test threshold - Added
mocha-debug(1)
- Added
mocha.opts
support. Closes #31 - Added: default [files] to test/*.js
- Added protection against multiple calls to
done()
. Closes #35 - Changed: bright yellow for slow Dot reporter tests
- Missed this one :)
- Initial release