mocha 6.2.1 → 6.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +20 -20
- package/lib/cli/node-flags.js +4 -1
- package/lib/cli/options.js +1 -0
- package/lib/mocha.js +16 -18
- package/lib/reporters/base.js +18 -3
- package/lib/reporters/html.js +2 -2
- package/lib/runner.js +1 -1
- package/mocha.js +38 -25
- package/package.json +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# 6.2.2 / 2019-10-18
|
|
2
|
+
|
|
3
|
+
## :bug: Fixes
|
|
4
|
+
|
|
5
|
+
- [#4025](https://github.com/mochajs/mocha/issues/4025): Fix duplicate `EVENT_RUN_END` events upon uncaught exception ([**@juergba**](https://github.com/juergba))
|
|
6
|
+
- [#4051](https://github.com/mochajs/mocha/issues/4051): Fix "unhide" function in `html` reporter (browser) ([**@pec9399**](https://github.com/pec9399))
|
|
7
|
+
- [#4063](https://github.com/mochajs/mocha/issues/4063): Fix use of [esm](https://npm.im/esm) in Node.js v8.x ([**@boneskull**](https://github.com/boneskull))
|
|
8
|
+
- [#4033](https://github.com/mochajs/mocha/issues/4033): Fix output when multiple async exceptions are thrown ([**@juergba**](https://github.com/juergba))
|
|
9
|
+
|
|
10
|
+
## :book: Documentation
|
|
11
|
+
|
|
12
|
+
- [#4046](https://github.com/mochajs/mocha/issues/4046): Site accessibility fixes ([**@Mia-jeong**](https://github.com/Mia-jeong))
|
|
13
|
+
- [#4026](https://github.com/mochajs/mocha/issues/4026): Update docs for custom reporters in browser ([**@Lindsay-Needs-Sleep**](https://github.com/Lindsay-Needs-Sleep))
|
|
14
|
+
- [#3971](https://github.com/mochajs/mocha/issues/3971): Adopt new OpenJS Foundation Code of Conduct ([**@craigtaub**](https://github.com/craigtaub))
|
|
15
|
+
|
|
1
16
|
# 6.2.1 / 2019-09-29
|
|
2
17
|
|
|
3
18
|
## :bug: Fixes
|
package/README.md
CHANGED
|
@@ -58,26 +58,26 @@
|
|
|
58
58
|
|
|
59
59
|
Does your company use Mocha? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. Also, your company's logo will show [on GitHub](https://github.com/mochajs/mocha#readme) and on [our site](https://mochajs.org) - who doesn't want a little extra exposure? [Here's the info](https://opencollective.com/mochajs#sponsor).
|
|
60
60
|
|
|
61
|
-
[](https://opencollective.com/mochajs/sponsor/0/website)
|
|
62
|
+
[](https://opencollective.com/mochajs/sponsor/1/website)
|
|
63
|
+
[](https://opencollective.com/mochajs/sponsor/2/website)
|
|
64
|
+
[](https://opencollective.com/mochajs/sponsor/3/website)
|
|
65
|
+
[](https://opencollective.com/mochajs/sponsor/4/website)
|
|
66
|
+
[](https://opencollective.com/mochajs/sponsor/5/website)
|
|
67
|
+
[](https://opencollective.com/mochajs/sponsor/6/website)
|
|
68
|
+
[](https://opencollective.com/mochajs/sponsor/7/website)
|
|
69
|
+
[](https://opencollective.com/mochajs/sponsor/8/website)
|
|
70
|
+
[](https://opencollective.com/mochajs/sponsor/9/website)
|
|
71
|
+
[](https://opencollective.com/mochajs/sponsor/10/website)
|
|
72
|
+
[](https://opencollective.com/mochajs/sponsor/11/website)
|
|
73
|
+
[](https://opencollective.com/mochajs/sponsor/12/website)
|
|
74
|
+
[](https://opencollective.com/mochajs/sponsor/13/website)
|
|
75
|
+
[](https://opencollective.com/mochajs/sponsor/14/website)
|
|
76
|
+
[](https://opencollective.com/mochajs/sponsor/15/website)
|
|
77
|
+
[](https://opencollective.com/mochajs/sponsor/16/website)
|
|
78
|
+
[](https://opencollective.com/mochajs/sponsor/17/website)
|
|
79
|
+
[](https://opencollective.com/mochajs/sponsor/18/website)
|
|
80
|
+
[](https://opencollective.com/mochajs/sponsor/19/website)
|
|
81
81
|
|
|
82
82
|
## Development
|
|
83
83
|
|
package/lib/cli/node-flags.js
CHANGED
|
@@ -68,6 +68,7 @@ exports.impliesNoTimeouts = flag => debugFlags.has(flag);
|
|
|
68
68
|
/**
|
|
69
69
|
* All non-strictly-boolean arguments to node--those with values--must specify those values using `=`, e.g., `--inspect=0.0.0.0`.
|
|
70
70
|
* Unparse these arguments using `yargs-unparser` (which would result in `--inspect 0.0.0.0`), then supply `=` where we have values.
|
|
71
|
+
* Apparently --require in Node.js v8 does NOT want `=`.
|
|
71
72
|
* There's probably an easier or more robust way to do this; fixes welcome
|
|
72
73
|
* @param {Object} opts - Arguments object
|
|
73
74
|
* @returns {string[]} Unparsed arguments using `=` to specify values
|
|
@@ -79,7 +80,9 @@ exports.unparseNodeFlags = opts => {
|
|
|
79
80
|
? args
|
|
80
81
|
.join(' ')
|
|
81
82
|
.split(/\b/)
|
|
82
|
-
.map(
|
|
83
|
+
.map((arg, index, args) =>
|
|
84
|
+
arg === ' ' && args[index - 1] !== 'require' ? '=' : arg
|
|
85
|
+
)
|
|
83
86
|
.join('')
|
|
84
87
|
.split(' ')
|
|
85
88
|
: [];
|
package/lib/cli/options.js
CHANGED
|
@@ -203,6 +203,7 @@ module.exports = function getOptions() {
|
|
|
203
203
|
* @param {string|boolean} [args.opts] - Filepath to mocha.opts; defaults to whatever's in `mocharc.opts`, or `false` to skip
|
|
204
204
|
* @returns {external:yargsParser.Arguments|void} If read, object containing parsed arguments
|
|
205
205
|
* @memberof module:lib/cli/options
|
|
206
|
+
* @see {@link /#mochaopts|mocha.opts}
|
|
206
207
|
* @public
|
|
207
208
|
*/
|
|
208
209
|
const loadMochaOpts = (args = {}) => {
|
package/lib/mocha.js
CHANGED
|
@@ -83,7 +83,7 @@ exports.Test = require('./test');
|
|
|
83
83
|
* @param {boolean} [options.ignoreLeaks] - Ignore global leaks?
|
|
84
84
|
* @param {boolean} [options.invert] - Invert test filter matches?
|
|
85
85
|
* @param {boolean} [options.noHighlighting] - Disable syntax highlighting?
|
|
86
|
-
* @param {string} [options.reporter] - Reporter name.
|
|
86
|
+
* @param {string|constructor} [options.reporter] - Reporter name or constructor.
|
|
87
87
|
* @param {Object} [options.reporterOption] - Reporter settings object.
|
|
88
88
|
* @param {number} [options.retries] - Number of times to retry failed tests.
|
|
89
89
|
* @param {number} [options.slow] - Slow threshold value.
|
|
@@ -163,7 +163,7 @@ function Mocha(options) {
|
|
|
163
163
|
* Enables or disables bailing on the first failure.
|
|
164
164
|
*
|
|
165
165
|
* @public
|
|
166
|
-
* @see {@link
|
|
166
|
+
* @see {@link /#-bail-b|CLI option}
|
|
167
167
|
* @param {boolean} [bail=true] - Whether to bail on first error.
|
|
168
168
|
* @returns {Mocha} this
|
|
169
169
|
* @chainable
|
|
@@ -184,7 +184,7 @@ Mocha.prototype.bail = function(bail) {
|
|
|
184
184
|
* Useful for generic setup code that must be included within test suite.
|
|
185
185
|
*
|
|
186
186
|
* @public
|
|
187
|
-
* @see {@link
|
|
187
|
+
* @see {@link /#-file-filedirectoryglob|CLI option}
|
|
188
188
|
* @param {string} file - Pathname of file to be loaded.
|
|
189
189
|
* @returns {Mocha} this
|
|
190
190
|
* @chainable
|
|
@@ -198,8 +198,8 @@ Mocha.prototype.addFile = function(file) {
|
|
|
198
198
|
* Sets reporter to `reporter`, defaults to "spec".
|
|
199
199
|
*
|
|
200
200
|
* @public
|
|
201
|
-
* @see {@link
|
|
202
|
-
* @see {@link
|
|
201
|
+
* @see {@link /#-reporter-name-r-name|CLI option}
|
|
202
|
+
* @see {@link /#reporters|Reporters}
|
|
203
203
|
* @param {String|Function} reporter - Reporter name or constructor.
|
|
204
204
|
* @param {Object} [reporterOptions] - Options used to configure the reporter.
|
|
205
205
|
* @returns {Mocha} this
|
|
@@ -265,8 +265,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions) {
|
|
|
265
265
|
* Sets test UI `name`, defaults to "bdd".
|
|
266
266
|
*
|
|
267
267
|
* @public
|
|
268
|
-
* @see {@link
|
|
269
|
-
* @see {@link
|
|
268
|
+
* @see {@link /#-ui-name-u-name|CLI option}
|
|
269
|
+
* @see {@link /#interfaces|Interface DSLs}
|
|
270
270
|
* @param {string|Function} [ui=bdd] - Interface name or class.
|
|
271
271
|
* @returns {Mocha} this
|
|
272
272
|
* @chainable
|
|
@@ -404,7 +404,7 @@ Mocha.prototype.fgrep = function(str) {
|
|
|
404
404
|
* <strong>Previous filter value will be overwritten on each call!</strong>
|
|
405
405
|
*
|
|
406
406
|
* @public
|
|
407
|
-
* @see {@link
|
|
407
|
+
* @see {@link /#grep-regexp-g-regexp|CLI option}
|
|
408
408
|
* @see {@link Mocha#fgrep}
|
|
409
409
|
* @see {@link Mocha#invert}
|
|
410
410
|
* @param {RegExp|String} re - Regular expression used to select tests.
|
|
@@ -474,7 +474,7 @@ Mocha.prototype.ignoreLeaks = function(ignoreLeaks) {
|
|
|
474
474
|
* Enables checking for global variables leaked while running tests.
|
|
475
475
|
*
|
|
476
476
|
* @public
|
|
477
|
-
* @see {@link
|
|
477
|
+
* @see {@link /#-check-leaks|CLI option}
|
|
478
478
|
* @see {@link Mocha#ignoreLeaks}
|
|
479
479
|
* @return {Mocha} this
|
|
480
480
|
* @chainable
|
|
@@ -544,7 +544,7 @@ Mocha.prototype._growl = growl.notify;
|
|
|
544
544
|
* Specifies whitelist of variable names to be expected in global scope.
|
|
545
545
|
*
|
|
546
546
|
* @public
|
|
547
|
-
* @see {@link
|
|
547
|
+
* @see {@link /#-global-variable-name|CLI option}
|
|
548
548
|
* @see {@link Mocha#checkLeaks}
|
|
549
549
|
* @param {String[]|String} globals - Accepted global variable name(s).
|
|
550
550
|
* @return {Mocha} this
|
|
@@ -615,9 +615,8 @@ Mocha.prototype.hideDiff = function(hideDiff) {
|
|
|
615
615
|
* If the value is `0`, timeouts will be disabled.
|
|
616
616
|
*
|
|
617
617
|
* @public
|
|
618
|
-
* @see {@link
|
|
619
|
-
* @see {@link
|
|
620
|
-
* @see {@link https://mochajs.org/#timeouts|Timeouts}
|
|
618
|
+
* @see {@link /#-timeout-ms-t-ms|CLI option}
|
|
619
|
+
* @see {@link /#timeouts|Timeouts}
|
|
621
620
|
* @see {@link Mocha#enableTimeouts}
|
|
622
621
|
* @param {number|string} msecs - Timeout threshold value.
|
|
623
622
|
* @return {Mocha} this
|
|
@@ -640,7 +639,7 @@ Mocha.prototype.timeout = function(msecs) {
|
|
|
640
639
|
* Sets the number of times to retry failed tests.
|
|
641
640
|
*
|
|
642
641
|
* @public
|
|
643
|
-
* @see {@link
|
|
642
|
+
* @see {@link /#retry-tests|Retry Tests}
|
|
644
643
|
* @param {number} retry - Number of times to retry failed tests.
|
|
645
644
|
* @return {Mocha} this
|
|
646
645
|
* @chainable
|
|
@@ -658,7 +657,7 @@ Mocha.prototype.retries = function(n) {
|
|
|
658
657
|
* Sets slowness threshold value.
|
|
659
658
|
*
|
|
660
659
|
* @public
|
|
661
|
-
* @see {@link
|
|
660
|
+
* @see {@link /#-slow-ms-s-ms|CLI option}
|
|
662
661
|
* @param {number} msecs - Slowness threshold value.
|
|
663
662
|
* @return {Mocha} this
|
|
664
663
|
* @chainable
|
|
@@ -680,8 +679,7 @@ Mocha.prototype.slow = function(msecs) {
|
|
|
680
679
|
* Enables or disables timeouts.
|
|
681
680
|
*
|
|
682
681
|
* @public
|
|
683
|
-
* @see {@link
|
|
684
|
-
* @see {@link https://mochajs.org/#--no-timeouts|CLI option}
|
|
682
|
+
* @see {@link /#-timeout-ms-t-ms|CLI option}
|
|
685
683
|
* @param {boolean} enableTimeouts - Whether to enable timeouts.
|
|
686
684
|
* @return {Mocha} this
|
|
687
685
|
* @chainable
|
|
@@ -737,7 +735,7 @@ Mocha.prototype.allowUncaught = function() {
|
|
|
737
735
|
* Used to perform asynch operations before any suites are run.
|
|
738
736
|
*
|
|
739
737
|
* @public
|
|
740
|
-
* @see {@link
|
|
738
|
+
* @see {@link /#delayed-root-suite|delayed root suite}
|
|
741
739
|
* @returns {Mocha} this
|
|
742
740
|
* @chainable
|
|
743
741
|
*/
|
package/lib/reporters/base.js
CHANGED
|
@@ -197,6 +197,7 @@ var generateDiff = (exports.generateDiff = function(actual, expected) {
|
|
|
197
197
|
* Error property
|
|
198
198
|
*/
|
|
199
199
|
exports.list = function(failures) {
|
|
200
|
+
var multipleErr, multipleTest;
|
|
200
201
|
Base.consoleLog();
|
|
201
202
|
failures.forEach(function(test, i) {
|
|
202
203
|
// format
|
|
@@ -207,7 +208,16 @@ exports.list = function(failures) {
|
|
|
207
208
|
|
|
208
209
|
// msg
|
|
209
210
|
var msg;
|
|
210
|
-
var err
|
|
211
|
+
var err;
|
|
212
|
+
if (test.err && test.err.multiple) {
|
|
213
|
+
if (multipleTest !== test) {
|
|
214
|
+
multipleTest = test;
|
|
215
|
+
multipleErr = [test.err].concat(test.err.multiple);
|
|
216
|
+
}
|
|
217
|
+
err = multipleErr.shift();
|
|
218
|
+
} else {
|
|
219
|
+
err = test.err;
|
|
220
|
+
}
|
|
211
221
|
var message;
|
|
212
222
|
if (err.message && typeof err.message.toString === 'function') {
|
|
213
223
|
message = err.message + '';
|
|
@@ -298,7 +308,12 @@ function Base(runner, options) {
|
|
|
298
308
|
if (showDiff(err)) {
|
|
299
309
|
stringifyDiffObjs(err);
|
|
300
310
|
}
|
|
301
|
-
|
|
311
|
+
// more than one error per test
|
|
312
|
+
if (test.err && err instanceof Error) {
|
|
313
|
+
test.err.multiple = (test.err.multiple || []).concat(err);
|
|
314
|
+
} else {
|
|
315
|
+
test.err = err;
|
|
316
|
+
}
|
|
302
317
|
failures.push(test);
|
|
303
318
|
});
|
|
304
319
|
}
|
|
@@ -307,7 +322,7 @@ function Base(runner, options) {
|
|
|
307
322
|
* Outputs common epilogue used by many of the bundled reporters.
|
|
308
323
|
*
|
|
309
324
|
* @public
|
|
310
|
-
* @memberof Mocha.reporters
|
|
325
|
+
* @memberof Mocha.reporters
|
|
311
326
|
*/
|
|
312
327
|
Base.prototype.epilogue = function() {
|
|
313
328
|
var stats = this.stats;
|
package/lib/reporters/html.js
CHANGED
|
@@ -357,8 +357,8 @@ function hideSuitesWithout(classname) {
|
|
|
357
357
|
*/
|
|
358
358
|
function unhide() {
|
|
359
359
|
var els = document.getElementsByClassName('suite hidden');
|
|
360
|
-
|
|
361
|
-
els[
|
|
360
|
+
while (els.length > 0) {
|
|
361
|
+
els[0].className = els[0].className.replace('suite hidden', 'suite');
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
|
package/lib/runner.js
CHANGED
package/mocha.js
CHANGED
|
@@ -1477,7 +1477,7 @@ exports.Test = require('./test');
|
|
|
1477
1477
|
* @param {boolean} [options.ignoreLeaks] - Ignore global leaks?
|
|
1478
1478
|
* @param {boolean} [options.invert] - Invert test filter matches?
|
|
1479
1479
|
* @param {boolean} [options.noHighlighting] - Disable syntax highlighting?
|
|
1480
|
-
* @param {string} [options.reporter] - Reporter name.
|
|
1480
|
+
* @param {string|constructor} [options.reporter] - Reporter name or constructor.
|
|
1481
1481
|
* @param {Object} [options.reporterOption] - Reporter settings object.
|
|
1482
1482
|
* @param {number} [options.retries] - Number of times to retry failed tests.
|
|
1483
1483
|
* @param {number} [options.slow] - Slow threshold value.
|
|
@@ -1557,7 +1557,7 @@ function Mocha(options) {
|
|
|
1557
1557
|
* Enables or disables bailing on the first failure.
|
|
1558
1558
|
*
|
|
1559
1559
|
* @public
|
|
1560
|
-
* @see {@link
|
|
1560
|
+
* @see {@link /#-bail-b|CLI option}
|
|
1561
1561
|
* @param {boolean} [bail=true] - Whether to bail on first error.
|
|
1562
1562
|
* @returns {Mocha} this
|
|
1563
1563
|
* @chainable
|
|
@@ -1578,7 +1578,7 @@ Mocha.prototype.bail = function(bail) {
|
|
|
1578
1578
|
* Useful for generic setup code that must be included within test suite.
|
|
1579
1579
|
*
|
|
1580
1580
|
* @public
|
|
1581
|
-
* @see {@link
|
|
1581
|
+
* @see {@link /#-file-filedirectoryglob|CLI option}
|
|
1582
1582
|
* @param {string} file - Pathname of file to be loaded.
|
|
1583
1583
|
* @returns {Mocha} this
|
|
1584
1584
|
* @chainable
|
|
@@ -1592,8 +1592,8 @@ Mocha.prototype.addFile = function(file) {
|
|
|
1592
1592
|
* Sets reporter to `reporter`, defaults to "spec".
|
|
1593
1593
|
*
|
|
1594
1594
|
* @public
|
|
1595
|
-
* @see {@link
|
|
1596
|
-
* @see {@link
|
|
1595
|
+
* @see {@link /#-reporter-name-r-name|CLI option}
|
|
1596
|
+
* @see {@link /#reporters|Reporters}
|
|
1597
1597
|
* @param {String|Function} reporter - Reporter name or constructor.
|
|
1598
1598
|
* @param {Object} [reporterOptions] - Options used to configure the reporter.
|
|
1599
1599
|
* @returns {Mocha} this
|
|
@@ -1659,8 +1659,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions) {
|
|
|
1659
1659
|
* Sets test UI `name`, defaults to "bdd".
|
|
1660
1660
|
*
|
|
1661
1661
|
* @public
|
|
1662
|
-
* @see {@link
|
|
1663
|
-
* @see {@link
|
|
1662
|
+
* @see {@link /#-ui-name-u-name|CLI option}
|
|
1663
|
+
* @see {@link /#interfaces|Interface DSLs}
|
|
1664
1664
|
* @param {string|Function} [ui=bdd] - Interface name or class.
|
|
1665
1665
|
* @returns {Mocha} this
|
|
1666
1666
|
* @chainable
|
|
@@ -1798,7 +1798,7 @@ Mocha.prototype.fgrep = function(str) {
|
|
|
1798
1798
|
* <strong>Previous filter value will be overwritten on each call!</strong>
|
|
1799
1799
|
*
|
|
1800
1800
|
* @public
|
|
1801
|
-
* @see {@link
|
|
1801
|
+
* @see {@link /#grep-regexp-g-regexp|CLI option}
|
|
1802
1802
|
* @see {@link Mocha#fgrep}
|
|
1803
1803
|
* @see {@link Mocha#invert}
|
|
1804
1804
|
* @param {RegExp|String} re - Regular expression used to select tests.
|
|
@@ -1868,7 +1868,7 @@ Mocha.prototype.ignoreLeaks = function(ignoreLeaks) {
|
|
|
1868
1868
|
* Enables checking for global variables leaked while running tests.
|
|
1869
1869
|
*
|
|
1870
1870
|
* @public
|
|
1871
|
-
* @see {@link
|
|
1871
|
+
* @see {@link /#-check-leaks|CLI option}
|
|
1872
1872
|
* @see {@link Mocha#ignoreLeaks}
|
|
1873
1873
|
* @return {Mocha} this
|
|
1874
1874
|
* @chainable
|
|
@@ -1938,7 +1938,7 @@ Mocha.prototype._growl = growl.notify;
|
|
|
1938
1938
|
* Specifies whitelist of variable names to be expected in global scope.
|
|
1939
1939
|
*
|
|
1940
1940
|
* @public
|
|
1941
|
-
* @see {@link
|
|
1941
|
+
* @see {@link /#-global-variable-name|CLI option}
|
|
1942
1942
|
* @see {@link Mocha#checkLeaks}
|
|
1943
1943
|
* @param {String[]|String} globals - Accepted global variable name(s).
|
|
1944
1944
|
* @return {Mocha} this
|
|
@@ -2009,9 +2009,8 @@ Mocha.prototype.hideDiff = function(hideDiff) {
|
|
|
2009
2009
|
* If the value is `0`, timeouts will be disabled.
|
|
2010
2010
|
*
|
|
2011
2011
|
* @public
|
|
2012
|
-
* @see {@link
|
|
2013
|
-
* @see {@link
|
|
2014
|
-
* @see {@link https://mochajs.org/#timeouts|Timeouts}
|
|
2012
|
+
* @see {@link /#-timeout-ms-t-ms|CLI option}
|
|
2013
|
+
* @see {@link /#timeouts|Timeouts}
|
|
2015
2014
|
* @see {@link Mocha#enableTimeouts}
|
|
2016
2015
|
* @param {number|string} msecs - Timeout threshold value.
|
|
2017
2016
|
* @return {Mocha} this
|
|
@@ -2034,7 +2033,7 @@ Mocha.prototype.timeout = function(msecs) {
|
|
|
2034
2033
|
* Sets the number of times to retry failed tests.
|
|
2035
2034
|
*
|
|
2036
2035
|
* @public
|
|
2037
|
-
* @see {@link
|
|
2036
|
+
* @see {@link /#retry-tests|Retry Tests}
|
|
2038
2037
|
* @param {number} retry - Number of times to retry failed tests.
|
|
2039
2038
|
* @return {Mocha} this
|
|
2040
2039
|
* @chainable
|
|
@@ -2052,7 +2051,7 @@ Mocha.prototype.retries = function(n) {
|
|
|
2052
2051
|
* Sets slowness threshold value.
|
|
2053
2052
|
*
|
|
2054
2053
|
* @public
|
|
2055
|
-
* @see {@link
|
|
2054
|
+
* @see {@link /#-slow-ms-s-ms|CLI option}
|
|
2056
2055
|
* @param {number} msecs - Slowness threshold value.
|
|
2057
2056
|
* @return {Mocha} this
|
|
2058
2057
|
* @chainable
|
|
@@ -2074,8 +2073,7 @@ Mocha.prototype.slow = function(msecs) {
|
|
|
2074
2073
|
* Enables or disables timeouts.
|
|
2075
2074
|
*
|
|
2076
2075
|
* @public
|
|
2077
|
-
* @see {@link
|
|
2078
|
-
* @see {@link https://mochajs.org/#--no-timeouts|CLI option}
|
|
2076
|
+
* @see {@link /#-timeout-ms-t-ms|CLI option}
|
|
2079
2077
|
* @param {boolean} enableTimeouts - Whether to enable timeouts.
|
|
2080
2078
|
* @return {Mocha} this
|
|
2081
2079
|
* @chainable
|
|
@@ -2131,7 +2129,7 @@ Mocha.prototype.allowUncaught = function() {
|
|
|
2131
2129
|
* Used to perform asynch operations before any suites are run.
|
|
2132
2130
|
*
|
|
2133
2131
|
* @public
|
|
2134
|
-
* @see {@link
|
|
2132
|
+
* @see {@link /#delayed-root-suite|delayed root suite}
|
|
2135
2133
|
* @returns {Mocha} this
|
|
2136
2134
|
* @chainable
|
|
2137
2135
|
*/
|
|
@@ -2471,6 +2469,7 @@ var generateDiff = (exports.generateDiff = function(actual, expected) {
|
|
|
2471
2469
|
* Error property
|
|
2472
2470
|
*/
|
|
2473
2471
|
exports.list = function(failures) {
|
|
2472
|
+
var multipleErr, multipleTest;
|
|
2474
2473
|
Base.consoleLog();
|
|
2475
2474
|
failures.forEach(function(test, i) {
|
|
2476
2475
|
// format
|
|
@@ -2481,7 +2480,16 @@ exports.list = function(failures) {
|
|
|
2481
2480
|
|
|
2482
2481
|
// msg
|
|
2483
2482
|
var msg;
|
|
2484
|
-
var err
|
|
2483
|
+
var err;
|
|
2484
|
+
if (test.err && test.err.multiple) {
|
|
2485
|
+
if (multipleTest !== test) {
|
|
2486
|
+
multipleTest = test;
|
|
2487
|
+
multipleErr = [test.err].concat(test.err.multiple);
|
|
2488
|
+
}
|
|
2489
|
+
err = multipleErr.shift();
|
|
2490
|
+
} else {
|
|
2491
|
+
err = test.err;
|
|
2492
|
+
}
|
|
2485
2493
|
var message;
|
|
2486
2494
|
if (err.message && typeof err.message.toString === 'function') {
|
|
2487
2495
|
message = err.message + '';
|
|
@@ -2572,7 +2580,12 @@ function Base(runner, options) {
|
|
|
2572
2580
|
if (showDiff(err)) {
|
|
2573
2581
|
stringifyDiffObjs(err);
|
|
2574
2582
|
}
|
|
2575
|
-
|
|
2583
|
+
// more than one error per test
|
|
2584
|
+
if (test.err && err instanceof Error) {
|
|
2585
|
+
test.err.multiple = (test.err.multiple || []).concat(err);
|
|
2586
|
+
} else {
|
|
2587
|
+
test.err = err;
|
|
2588
|
+
}
|
|
2576
2589
|
failures.push(test);
|
|
2577
2590
|
});
|
|
2578
2591
|
}
|
|
@@ -2581,7 +2594,7 @@ function Base(runner, options) {
|
|
|
2581
2594
|
* Outputs common epilogue used by many of the bundled reporters.
|
|
2582
2595
|
*
|
|
2583
2596
|
* @public
|
|
2584
|
-
* @memberof Mocha.reporters
|
|
2597
|
+
* @memberof Mocha.reporters
|
|
2585
2598
|
*/
|
|
2586
2599
|
Base.prototype.epilogue = function() {
|
|
2587
2600
|
var stats = this.stats;
|
|
@@ -3309,8 +3322,8 @@ function hideSuitesWithout(classname) {
|
|
|
3309
3322
|
*/
|
|
3310
3323
|
function unhide() {
|
|
3311
3324
|
var els = document.getElementsByClassName('suite hidden');
|
|
3312
|
-
|
|
3313
|
-
els[
|
|
3325
|
+
while (els.length > 0) {
|
|
3326
|
+
els[0].className = els[0].className.replace('suite hidden', 'suite');
|
|
3314
3327
|
}
|
|
3315
3328
|
}
|
|
3316
3329
|
|
|
@@ -6338,7 +6351,7 @@ Runner.prototype.uncaught = function(err) {
|
|
|
6338
6351
|
}
|
|
6339
6352
|
|
|
6340
6353
|
// bail
|
|
6341
|
-
this.
|
|
6354
|
+
this.abort();
|
|
6342
6355
|
};
|
|
6343
6356
|
|
|
6344
6357
|
/**
|
|
@@ -18073,7 +18086,7 @@ function hasOwnProperty(obj, prop) {
|
|
|
18073
18086
|
},{"./support/isBuffer":88,"_process":69,"inherits":56}],90:[function(require,module,exports){
|
|
18074
18087
|
module.exports={
|
|
18075
18088
|
"name": "mocha",
|
|
18076
|
-
"version": "6.2.
|
|
18089
|
+
"version": "6.2.2",
|
|
18077
18090
|
"homepage": "https://mochajs.org/",
|
|
18078
18091
|
"notifyLogo": "https://ibin.co/4QuRuGjXvl36.png"
|
|
18079
18092
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
4
4
|
"description": "simple, flexible, fun test framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mocha",
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
"Enric Pallerols <enric@pallerols.cat>",
|
|
148
148
|
"Erik Eng <mail@ptz0n.se>",
|
|
149
149
|
"Eugene Tiutiunnyk <eugene.tiutiunnyk@lookout.com>",
|
|
150
|
+
"EunChan Park <pec9399@naver.com>",
|
|
150
151
|
"Fabio M. Costa <fabiomcosta@gmail.com>",
|
|
151
152
|
"Fábio Santos <fabiosantosart@gmail.com>",
|
|
152
153
|
"Fagner Brack <github3@fagnermartins.com>",
|
|
@@ -286,6 +287,7 @@
|
|
|
286
287
|
"László Bácsi <lackac@lackac.hu>",
|
|
287
288
|
"Laurence Rowe <lrowe@netflix.com>",
|
|
288
289
|
"Liam Newman <bitwiseman@gmail.com>",
|
|
290
|
+
"Lindsay-Needs-Sleep <51773923+Lindsay-Needs-Sleep@users.noreply.github.com>",
|
|
289
291
|
"Linus Unnebäck <linus@folkdatorn.se>",
|
|
290
292
|
"lodr <salva@unoyunodiez.com>",
|
|
291
293
|
"Long Ho <longlho@users.noreply.github.com>",
|
|
@@ -312,6 +314,7 @@
|
|
|
312
314
|
"Max Goodman <c@chromakode.com>",
|
|
313
315
|
"Maximilian Antoni <mail@maxantoni.de>",
|
|
314
316
|
"Merrick Christensen <merrick.christensen@gmail.com>",
|
|
317
|
+
"Mia <miajeongdev@gmail.com>",
|
|
315
318
|
"Michael Demmer <demmer@jut.io>",
|
|
316
319
|
"Michael Jackson <mjijackson@gmail.com>",
|
|
317
320
|
"Michael Olson <mwolson@member.fsf.org>",
|
|
@@ -542,7 +545,8 @@
|
|
|
542
545
|
"devDependencies": {
|
|
543
546
|
"@11ty/eleventy": "^0.8.3",
|
|
544
547
|
"@mocha/contributors": "^1.0.4",
|
|
545
|
-
"@mocha/docdash": "^2.1.
|
|
548
|
+
"@mocha/docdash": "^2.1.2",
|
|
549
|
+
"acorn": "^7.0.0",
|
|
546
550
|
"assetgraph-builder": "^6.10.1",
|
|
547
551
|
"autoprefixer": "^9.6.0",
|
|
548
552
|
"browserify": "^16.2.3",
|
|
@@ -563,7 +567,8 @@
|
|
|
563
567
|
"eslint-plugin-standard": "^4.0.0",
|
|
564
568
|
"fs-extra": "^8.0.1",
|
|
565
569
|
"husky": "^1.3.1",
|
|
566
|
-
"
|
|
570
|
+
"hyperlink": "^4.3.1",
|
|
571
|
+
"jsdoc": "^3.6.3",
|
|
567
572
|
"karma": "^4.1.0",
|
|
568
573
|
"karma-browserify": "^6.0.0",
|
|
569
574
|
"karma-chrome-launcher": "^2.2.0",
|