[x] \ is now only used as an escape character, and never as a path separator in glob patterns, so that Windows users have a way to match against filenames containing literal glob pattern characters.
[x] Glob pattern paths must use forward-slashes as path separators, since \ is an escape character to match literal glob pattern characters.
[x] https://github.com/mochajs/mocha/issues/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.
[ ] https://github.com/mochajs/mocha/issues/3125: For consumers of Mocha's programmatic API, all exceptions thrown from Mocha now have a code property (and some will have additional metadata). Some Error messages have changed. Please use the code property to check Error types instead of the message property; these descriptions will be localized in the future. (@craigtaub)
https://github.com/mochajs/mocha/issues/3741: When conditionally skipping in a beforeEach hook, subsequent inner beforeEach hooks are now skipped and related afterEach hooks are executed
[ ] https://github.com/mochajs/mocha/issues/4260: Remove enableTimeout() (this.enableTimeout()) from the context object (@craigtaub)
✨ WORKAROUND: Replace usage of this.enableTimeout(false) in your tests with this.timeout(0).
[ ] https://github.com/mochajs/mocha/issues/4315: The spec option no longer supports a comma-delimited list of files (@juergba)
✨ WORKAROUND: Use an array instead (e.g., "spec": "foo.js,bar.js" becomes "spec": ["foo.js", "bar.js"]).
[ ] https://github.com/mochajs/mocha/issues/4223: The context object's skip() (this.skip()) in a "before all" (before()) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites (@juergba)
[ ] https://github.com/mochajs/mocha/issues/4635: import-first loading of test files (@giltayar)
Mocha is going ESM-first! This means that it will now use ESM import(test_file) to load the test files, instead of the CommonJS require(test_file). This is not a problem, as import can also load most files that require does. In the rare cases where this fails, it will fallback to require(...). This ESM-first approach is the next step in Mocha's ESM migration, and allows ESM loaders to load and transform the test file.
[x] \ is now only used as an escape character, and never as a path separator in glob patterns, so that Windows users have a way to match against filenames containing literal glob pattern characters.
[x] Glob pattern paths must use forward-slashes as path separators, since \ is an escape character to match literal glob pattern characters.
[x] (8.0.2) cwd and root will always be automatically coerced to use / as path separators on Windows, as they cannot contain glob patterns anyway, and are often supplied by path.resolve() and other methods that will use \ path separators by default.
[x] Dropped support for Node.js versions less than v14.
[x] Upgraded jsdoc-api which now uses jsdoc version v4.0.0 internally. From v4.0.0 onward, jsdoc requires Node v12. This was a breaking change for jsdoc but not for jsdoc2md as it already requires v12+, however this jsdoc2md release is a major version increment just to be on the safe side.
[x] Remove official node v4 support. It probably still works with node v4, but no guarantees anymore.
[ ] Replace babel with regex-based transformation 9b77ed9a293c538ec3eb5160bcb933e012ce517f. This should not break, but it has been flagged as major version bump as the regex might not catch all cases reliably and thus fail for some users.
[x] Remove Node v6 support. We had to do this because one of our dependencies had security issues and the version with the fix dropped Node v6 as well.
[x] Remove Node v8 support. We had to do this because one of our dependencies had security issues and the version with the fix dropped Node v8 as well.
Summary of changes:
Updated a lot of dependencies
Simply updated
\
is now only used as an escape character, and never as a path separator in glob patterns, so that Windows users have a way to match against filenames containing literal glob pattern characters.\
is an escape character to match literal glob pattern characters.--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--watch-extensions
no longer impliesjs
; it must be explicitly added (@TheDancingCode)tap
reporter emits error messages (@chrmod)before
hook, subsequentbefore
hooks and tests in nested suites are now skipped (@bannmoore)lib/template.html
has moved tolib/browser/template.html
(@boneskull)mocha.opts
at a user-specified path (@plroebuck)Base
-extending reporter without aRunner
parameter will throw an exception (@craigtaub)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)--debug
/--debug-brk
and deprecatedebug
argument (@juergba)--list-interfaces
replaces--interfaces
--list-reporters
replaces--reporters
this.skip()
(@juergba):it
test, relatedafterEach
hooks are now executedbeforeEach
hook, subsequent innerbeforeEach
hooks are now skipped and relatedafterEach
hooks are executedthis.skip()
within after hooksgetOptions()
andlib/cli/options.js
(@juergba)pending
test: don't swallow, but retrospectively fail the test for correct exit code (@juergba)Mocha
constructor's option names with command-line options (@juergba)mocha.opts
is no longer supported (@juergba) ✨ WORKAROUND: Replacemocha.opts
with a configuration file.enableTimeout()
(this.enableTimeout()
) from the context object (@craigtaub) ✨ WORKAROUND: Replace usage ofthis.enableTimeout(false)
in your tests withthis.timeout(0)
.spec
option no longer supports a comma-delimited list of files (@juergba) ✨ WORKAROUND: Use an array instead (e.g.,"spec": "foo.js,bar.js"
becomes"spec": ["foo.js", "bar.js"]
).--forbid-only
will throw an error even if exclusive tests are avoided via--grep
or other means (@arvidOtt)skip()
(this.skip()
) in a "before all" (before()
) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites (@juergba)Mocha.prototype.ignoreLeaks()
Mocha.prototype.useColors()
Mocha.prototype.useInlineDiffs()
Mocha.prototype.hideDiff()
import
-first loading of test files (@giltayar) Mocha is going ESM-first! This means that it will now use ESMimport(test_file)
to load the test files, instead of the CommonJSrequire(test_file)
. This is not a problem, asimport
can also load most files thatrequire
does. In the rare cases where this fails, it will fallback torequire(...)
. This ESM-first approach is the next step in Mocha's ESM migration, and allows ESM loaders to load and transform the test file.utils.lookupFiles()
(@juergba)actual
/expected
fordiff
generation (@juergba)bin/mocha
tobin/mocha.js
(@juergba)--ignore
option in Windows: upgrade Minimatch (@juergba)Runner
signature (@juergba)minimist
, no Breaking changes within CHANGELOGfs-extra
, no Breaking changes within CHANGELOGjshint
, no Breaking changes within CHANGELOGhttp-auth
, no Breaking changes within CHANGELOGglob
, Breaking Changes according to CHANGELOG:\
is now only used as an escape character, and never as a path separator in glob patterns, so that Windows users have a way to match against filenames containing literal glob pattern characters.\
is an escape character to match literal glob pattern characters.cwd
androot
will always be automatically coerced to use/
as path separators on Windows, as they cannot contain glob patterns anyway, and are often supplied bypath.resolve()
and other methods that will use\
path separators by default.jsdoc-to-markdown
, Breaking Changes according to CHANGELOG:markdown-it
, no Breaking Changes according to CHANGELOGrewire
, Breaking Changes according to CHANGELOG:event-stream
, no Breaking Changes according to CHANGELOG@reach/visually-hidden
, no Breaking Changes according to CHANGELOGarchiver
, no Breaking Changes according to CHANGELOGdeepmerge
, no Breaking Changes according to CHANGELOGwebpack
, simply updated by major version