mocha 9.1.2 → 9.2.1

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.
Files changed (46) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/browser-entry.js +26 -16
  4. package/lib/browser/growl.js +5 -5
  5. package/lib/browser/parse-query.js +1 -1
  6. package/lib/browser/progress.js +6 -6
  7. package/lib/cli/config.js +7 -12
  8. package/lib/cli/run.js +1 -1
  9. package/lib/cli/watch-run.js +1 -4
  10. package/lib/context.js +5 -5
  11. package/lib/errors.js +1 -1
  12. package/lib/hook.js +2 -2
  13. package/lib/interfaces/bdd.js +23 -20
  14. package/lib/interfaces/common.js +7 -7
  15. package/lib/interfaces/exports.js +1 -1
  16. package/lib/interfaces/qunit.js +7 -7
  17. package/lib/interfaces/tdd.js +9 -9
  18. package/lib/mocha.js +56 -58
  19. package/lib/nodejs/buffered-worker-pool.js +17 -1
  20. package/lib/nodejs/esm-utils.js +18 -3
  21. package/lib/reporters/base.js +41 -28
  22. package/lib/reporters/doc.js +4 -4
  23. package/lib/reporters/dot.js +5 -5
  24. package/lib/reporters/html.js +12 -12
  25. package/lib/reporters/json-stream.js +4 -4
  26. package/lib/reporters/json.js +7 -7
  27. package/lib/reporters/landing.js +5 -5
  28. package/lib/reporters/list.js +5 -5
  29. package/lib/reporters/markdown.js +5 -5
  30. package/lib/reporters/min.js +1 -1
  31. package/lib/reporters/nyan.js +16 -16
  32. package/lib/reporters/progress.js +3 -3
  33. package/lib/reporters/spec.js +6 -6
  34. package/lib/reporters/tap.js +17 -17
  35. package/lib/reporters/xunit.js +9 -9
  36. package/lib/runnable.js +21 -21
  37. package/lib/runner.js +44 -47
  38. package/lib/stats-collector.js +7 -7
  39. package/lib/suite.js +44 -73
  40. package/lib/test.js +4 -4
  41. package/lib/utils.js +18 -19
  42. package/mocha-es2018.js +432 -449
  43. package/mocha.js +1246 -851
  44. package/mocha.js.map +1 -1
  45. package/package.json +38 -38
  46. package/CHANGELOG.md +0 -1015
package/mocha-es2018.js CHANGED
@@ -1,4 +1,4 @@
1
- // mocha@9.1.2 in javascript ES2018
1
+ // mocha@9.2.1 in javascript ES2018
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -7383,7 +7383,7 @@
7383
7383
  return qs
7384
7384
  .replace('?', '')
7385
7385
  .split('&')
7386
- .reduce(function(obj, pair) {
7386
+ .reduce(function (obj, pair) {
7387
7387
  var i = pair.indexOf('=');
7388
7388
  var key = pair.slice(0, i);
7389
7389
  var val = pair.slice(++i);
@@ -9425,30 +9425,22 @@
9425
9425
 
9426
9426
  var browser$2 = true;
9427
9427
 
9428
- // This alphabet uses `A-Za-z0-9_-` symbols. The genetic algorithm helped
9429
- // optimize the gzip compression for this alphabet.
9430
9428
  let urlAlphabet =
9431
- 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW';
9432
-
9429
+ 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
9433
9430
  let customAlphabet = (alphabet, size) => {
9434
9431
  return () => {
9435
9432
  let id = '';
9436
- // A compact alternative for `for (var i = 0; i < step; i++)`.
9437
9433
  let i = size;
9438
9434
  while (i--) {
9439
- // `| 0` is more compact and faster than `Math.floor()`.
9440
9435
  id += alphabet[(Math.random() * alphabet.length) | 0];
9441
9436
  }
9442
9437
  return id
9443
9438
  }
9444
9439
  };
9445
-
9446
9440
  let nanoid = (size = 21) => {
9447
9441
  let id = '';
9448
- // A compact alternative for `for (var i = 0; i < step; i++)`.
9449
9442
  let i = size;
9450
9443
  while (i--) {
9451
- // `| 0` is more compact and faster than `Math.floor()`.
9452
9444
  id += urlAlphabet[(Math.random() * 64) | 0];
9453
9445
  }
9454
9446
  return id
@@ -9835,7 +9827,7 @@
9835
9827
  * @param {string} html
9836
9828
  * @return {string}
9837
9829
  */
9838
- exports.escape = function(html) {
9830
+ exports.escape = function (html) {
9839
9831
  return he.encode(String(html), {useNamedReferences: false});
9840
9832
  };
9841
9833
 
@@ -9846,7 +9838,7 @@
9846
9838
  * @param {Object} obj
9847
9839
  * @return {boolean}
9848
9840
  */
9849
- exports.isString = function(obj) {
9841
+ exports.isString = function (obj) {
9850
9842
  return typeof obj === 'string';
9851
9843
  };
9852
9844
 
@@ -9857,7 +9849,7 @@
9857
9849
  * @param {string} str
9858
9850
  * @return {string}
9859
9851
  */
9860
- exports.slug = function(str) {
9852
+ exports.slug = function (str) {
9861
9853
  return str
9862
9854
  .toLowerCase()
9863
9855
  .replace(/\s+/g, '-')
@@ -9871,7 +9863,7 @@
9871
9863
  * @param {string} str
9872
9864
  * @return {string}
9873
9865
  */
9874
- exports.clean = function(str) {
9866
+ exports.clean = function (str) {
9875
9867
  str = str
9876
9868
  .replace(/\r\n?|[\n\u2028\u2029]/g, '\n')
9877
9869
  .replace(/^\uFEFF/, '')
@@ -10013,7 +10005,7 @@
10013
10005
  * @param {*} value
10014
10006
  * @return {string}
10015
10007
  */
10016
- exports.stringify = function(value) {
10008
+ exports.stringify = function (value) {
10017
10009
  var typeHint = canonicalType(value);
10018
10010
 
10019
10011
  if (!~['object', 'array', 'function'].indexOf(typeHint)) {
@@ -10029,7 +10021,7 @@
10029
10021
  // IE7/IE8 has a bizarre String constructor; needs to be coerced
10030
10022
  // into an array and back to obj.
10031
10023
  if (typeHint === 'string' && typeof value === 'object') {
10032
- value = value.split('').reduce(function(acc, char, idx) {
10024
+ value = value.split('').reduce(function (acc, char, idx) {
10033
10025
  acc[idx] = char;
10034
10026
  return acc;
10035
10027
  }, {});
@@ -10184,8 +10176,8 @@
10184
10176
  canonicalizedObj = value;
10185
10177
  break;
10186
10178
  case 'array':
10187
- withStack(value, function() {
10188
- canonicalizedObj = value.map(function(item) {
10179
+ withStack(value, function () {
10180
+ canonicalizedObj = value.map(function (item) {
10189
10181
  return exports.canonicalize(item, stack);
10190
10182
  });
10191
10183
  });
@@ -10204,10 +10196,10 @@
10204
10196
  /* falls through */
10205
10197
  case 'object':
10206
10198
  canonicalizedObj = canonicalizedObj || {};
10207
- withStack(value, function() {
10199
+ withStack(value, function () {
10208
10200
  Object.keys(value)
10209
10201
  .sort()
10210
- .forEach(function(key) {
10202
+ .forEach(function (key) {
10211
10203
  canonicalizedObj[key] = exports.canonicalize(value[key], stack);
10212
10204
  });
10213
10205
  });
@@ -10235,7 +10227,7 @@
10235
10227
  * (i.e: strip Mocha and internal node functions from stack trace).
10236
10228
  * @returns {Function}
10237
10229
  */
10238
- exports.stackTraceFilter = function() {
10230
+ exports.stackTraceFilter = function () {
10239
10231
  // TODO: Replace with `process.browser`
10240
10232
  var is = typeof document === 'undefined' ? {node: true} : {browser: true};
10241
10233
  var slash = path.sep;
@@ -10243,9 +10235,8 @@
10243
10235
  if (is.node) {
10244
10236
  cwd = exports.cwd() + slash;
10245
10237
  } else {
10246
- cwd = (typeof location === 'undefined'
10247
- ? window.location
10248
- : location
10238
+ cwd = (
10239
+ typeof location === 'undefined' ? window.location : location
10249
10240
  ).href.replace(/\/[^/]*$/, '/');
10250
10241
  slash = '/';
10251
10242
  }
@@ -10269,10 +10260,10 @@
10269
10260
  );
10270
10261
  }
10271
10262
 
10272
- return function(stack) {
10263
+ return function (stack) {
10273
10264
  stack = stack.split('\n');
10274
10265
 
10275
- stack = stack.reduce(function(list, line) {
10266
+ stack = stack.reduce(function (list, line) {
10276
10267
  if (isMochaInternal(line)) {
10277
10268
  return list;
10278
10269
  }
@@ -10323,7 +10314,7 @@
10323
10314
  * It's a noop.
10324
10315
  * @public
10325
10316
  */
10326
- exports.noop = function() {};
10317
+ exports.noop = function () {};
10327
10318
 
10328
10319
  /**
10329
10320
  * Creates a map-like object.
@@ -10340,7 +10331,7 @@
10340
10331
  * @param {...*} [obj] - Arguments to `Object.assign()`.
10341
10332
  * @returns {Object} An object with no prototype, having `...obj` properties
10342
10333
  */
10343
- exports.createMap = function(obj) {
10334
+ exports.createMap = function (obj) {
10344
10335
  return Object.assign.apply(
10345
10336
  null,
10346
10337
  [Object.create(null)].concat(Array.prototype.slice.call(arguments))
@@ -10359,7 +10350,7 @@
10359
10350
  * @returns {Object} A frozen object with no prototype, having `...obj` properties
10360
10351
  * @throws {TypeError} if argument is not a non-empty object.
10361
10352
  */
10362
- exports.defineConstants = function(obj) {
10353
+ exports.defineConstants = function (obj) {
10363
10354
  if (canonicalType(obj) !== 'object' || !Object.keys(obj).length) {
10364
10355
  throw new TypeError('Invalid argument; expected a non-empty object');
10365
10356
  }
@@ -10669,7 +10660,7 @@
10669
10660
 
10670
10661
  /**
10671
10662
  * Selects a color for a debug namespace
10672
- * @param {String} namespace The namespace string for the for the debug instance to be colored
10663
+ * @param {String} namespace The namespace string for the debug instance to be colored
10673
10664
  * @return {Number|String} An ANSI color code for the given namespace
10674
10665
  * @api private
10675
10666
  */
@@ -11198,7 +11189,7 @@
11198
11189
  process$1.emitWarning(msg, type);
11199
11190
  } else {
11200
11191
  /* istanbul ignore next */
11201
- nextTick$1(function() {
11192
+ nextTick$1(function () {
11202
11193
  console.warn(type + ': ' + msg);
11203
11194
  });
11204
11195
  }
@@ -11790,7 +11781,7 @@
11790
11781
  /**
11791
11782
  * Resets the state initially or for a next run.
11792
11783
  */
11793
- Runnable.prototype.reset = function() {
11784
+ Runnable.prototype.reset = function () {
11794
11785
  this.timedOut = false;
11795
11786
  this._currentRetry = 0;
11796
11787
  this.pending = false;
@@ -11819,7 +11810,7 @@
11819
11810
  * @returns {Runnable} this
11820
11811
  * @chainable
11821
11812
  */
11822
- Runnable.prototype.timeout = function(ms) {
11813
+ Runnable.prototype.timeout = function (ms) {
11823
11814
  if (!arguments.length) {
11824
11815
  return this._timeout;
11825
11816
  }
@@ -11853,7 +11844,7 @@
11853
11844
  * @param {number|string} ms
11854
11845
  * @return {Runnable|number} ms or Runnable instance.
11855
11846
  */
11856
- Runnable.prototype.slow = function(ms) {
11847
+ Runnable.prototype.slow = function (ms) {
11857
11848
  if (!arguments.length || typeof ms === 'undefined') {
11858
11849
  return this._slow;
11859
11850
  }
@@ -11871,7 +11862,7 @@
11871
11862
  * @memberof Mocha.Runnable
11872
11863
  * @public
11873
11864
  */
11874
- Runnable.prototype.skip = function() {
11865
+ Runnable.prototype.skip = function () {
11875
11866
  this.pending = true;
11876
11867
  throw new pending('sync skip; aborting execution');
11877
11868
  };
@@ -11881,7 +11872,7 @@
11881
11872
  *
11882
11873
  * @private
11883
11874
  */
11884
- Runnable.prototype.isPending = function() {
11875
+ Runnable.prototype.isPending = function () {
11885
11876
  return this.pending || (this.parent && this.parent.isPending());
11886
11877
  };
11887
11878
 
@@ -11890,7 +11881,7 @@
11890
11881
  * @return {boolean}
11891
11882
  * @private
11892
11883
  */
11893
- Runnable.prototype.isFailed = function() {
11884
+ Runnable.prototype.isFailed = function () {
11894
11885
  return !this.isPending() && this.state === constants$3.STATE_FAILED;
11895
11886
  };
11896
11887
 
@@ -11899,7 +11890,7 @@
11899
11890
  * @return {boolean}
11900
11891
  * @private
11901
11892
  */
11902
- Runnable.prototype.isPassed = function() {
11893
+ Runnable.prototype.isPassed = function () {
11903
11894
  return !this.isPending() && this.state === constants$3.STATE_PASSED;
11904
11895
  };
11905
11896
 
@@ -11908,7 +11899,7 @@
11908
11899
  *
11909
11900
  * @private
11910
11901
  */
11911
- Runnable.prototype.retries = function(n) {
11902
+ Runnable.prototype.retries = function (n) {
11912
11903
  if (!arguments.length) {
11913
11904
  return this._retries;
11914
11905
  }
@@ -11920,7 +11911,7 @@
11920
11911
  *
11921
11912
  * @private
11922
11913
  */
11923
- Runnable.prototype.currentRetry = function(n) {
11914
+ Runnable.prototype.currentRetry = function (n) {
11924
11915
  if (!arguments.length) {
11925
11916
  return this._currentRetry;
11926
11917
  }
@@ -11935,7 +11926,7 @@
11935
11926
  * @public
11936
11927
  * @return {string}
11937
11928
  */
11938
- Runnable.prototype.fullTitle = function() {
11929
+ Runnable.prototype.fullTitle = function () {
11939
11930
  return this.titlePath().join(' ');
11940
11931
  };
11941
11932
 
@@ -11946,7 +11937,7 @@
11946
11937
  * @public
11947
11938
  * @return {string}
11948
11939
  */
11949
- Runnable.prototype.titlePath = function() {
11940
+ Runnable.prototype.titlePath = function () {
11950
11941
  return this.parent.titlePath().concat([this.title]);
11951
11942
  };
11952
11943
 
@@ -11955,7 +11946,7 @@
11955
11946
  *
11956
11947
  * @private
11957
11948
  */
11958
- Runnable.prototype.clearTimeout = function() {
11949
+ Runnable.prototype.clearTimeout = function () {
11959
11950
  clearTimeout$1(this.timer);
11960
11951
  };
11961
11952
 
@@ -11964,7 +11955,7 @@
11964
11955
  *
11965
11956
  * @private
11966
11957
  */
11967
- Runnable.prototype.resetTimeout = function() {
11958
+ Runnable.prototype.resetTimeout = function () {
11968
11959
  var self = this;
11969
11960
  var ms = this.timeout();
11970
11961
 
@@ -11972,7 +11963,7 @@
11972
11963
  return;
11973
11964
  }
11974
11965
  this.clearTimeout();
11975
- this.timer = setTimeout$3(function() {
11966
+ this.timer = setTimeout$3(function () {
11976
11967
  if (self.timeout() === 0) {
11977
11968
  return;
11978
11969
  }
@@ -11987,7 +11978,7 @@
11987
11978
  * @private
11988
11979
  * @param {string[]} globals
11989
11980
  */
11990
- Runnable.prototype.globals = function(globals) {
11981
+ Runnable.prototype.globals = function (globals) {
11991
11982
  if (!arguments.length) {
11992
11983
  return this._allowedGlobals;
11993
11984
  }
@@ -12000,7 +11991,7 @@
12000
11991
  * @param {Function} fn
12001
11992
  * @private
12002
11993
  */
12003
- Runnable.prototype.run = function(fn) {
11994
+ Runnable.prototype.run = function (fn) {
12004
11995
  var self = this;
12005
11996
  var start = new Date$4();
12006
11997
  var ctx = this.ctx;
@@ -12100,13 +12091,13 @@
12100
12091
  if (result && typeof result.then === 'function') {
12101
12092
  self.resetTimeout();
12102
12093
  result.then(
12103
- function() {
12094
+ function () {
12104
12095
  done();
12105
12096
  // Return null so libraries like bluebird do not warn about
12106
12097
  // subsequently constructed Promises.
12107
12098
  return null;
12108
12099
  },
12109
- function(reason) {
12100
+ function (reason) {
12110
12101
  done(reason || new Error('Promise rejected with no or falsy reason'));
12111
12102
  }
12112
12103
  );
@@ -12124,7 +12115,7 @@
12124
12115
  }
12125
12116
 
12126
12117
  function callFnAsync(fn) {
12127
- var result = fn.call(ctx, function(err) {
12118
+ var result = fn.call(ctx, function (err) {
12128
12119
  if (err instanceof Error || toString.call(err) === '[object Error]') {
12129
12120
  return done(err);
12130
12121
  }
@@ -12156,7 +12147,7 @@
12156
12147
  * @returns {Error} a "timeout" error
12157
12148
  * @private
12158
12149
  */
12159
- Runnable.prototype._timeoutError = function(ms) {
12150
+ Runnable.prototype._timeoutError = function (ms) {
12160
12151
  let msg = `Timeout of ${ms}ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.`;
12161
12152
  if (this.file) {
12162
12153
  msg += ' (' + this.file + ')';
@@ -12196,7 +12187,7 @@
12196
12187
  * @returns {*|Error} `value`, otherwise an `Error`
12197
12188
  * @private
12198
12189
  */
12199
- Runnable.toValueOrError = function(value) {
12190
+ Runnable.toValueOrError = function (value) {
12200
12191
  return (
12201
12192
  value ||
12202
12193
  createInvalidExceptionError$1(
@@ -12238,7 +12229,7 @@
12238
12229
  /**
12239
12230
  * Resets the state for a next run.
12240
12231
  */
12241
- Hook.prototype.reset = function() {
12232
+ Hook.prototype.reset = function () {
12242
12233
  runnable.prototype.reset.call(this);
12243
12234
  delete this._error;
12244
12235
  };
@@ -12251,7 +12242,7 @@
12251
12242
  * @param {Error} err
12252
12243
  * @return {Error}
12253
12244
  */
12254
- Hook.prototype.error = function(err) {
12245
+ Hook.prototype.error = function (err) {
12255
12246
  if (!arguments.length) {
12256
12247
  err = this._error;
12257
12248
  this._error = null;
@@ -12307,7 +12298,6 @@
12307
12298
  assignNewMochaID,
12308
12299
  clamp,
12309
12300
  constants: utilsConstants,
12310
- createMap,
12311
12301
  defineConstants,
12312
12302
  getMochaID,
12313
12303
  inherits,
@@ -12333,7 +12323,7 @@
12333
12323
  * @param {string} title - Title
12334
12324
  * @return {Suite}
12335
12325
  */
12336
- Suite.create = function(parent, title) {
12326
+ Suite.create = function (parent, title) {
12337
12327
  var suite = new Suite(title, parent.ctx);
12338
12328
  suite.parent = parent;
12339
12329
  title = suite.fullTitle();
@@ -12389,16 +12379,6 @@
12389
12379
  });
12390
12380
 
12391
12381
  this.reset();
12392
-
12393
- this.on('newListener', function(event) {
12394
- if (deprecatedEvents[event]) {
12395
- errors.deprecate(
12396
- 'Event "' +
12397
- event +
12398
- '" is deprecated. Please let the Mocha team know about your use case: https://git.io/v6Lwm'
12399
- );
12400
- }
12401
- });
12402
12382
  }
12403
12383
 
12404
12384
  /**
@@ -12409,7 +12389,7 @@
12409
12389
  /**
12410
12390
  * Resets the state initially or for a next run.
12411
12391
  */
12412
- Suite.prototype.reset = function() {
12392
+ Suite.prototype.reset = function () {
12413
12393
  this.delayed = false;
12414
12394
  function doReset(thingToReset) {
12415
12395
  thingToReset.reset();
@@ -12428,7 +12408,7 @@
12428
12408
  * @private
12429
12409
  * @return {Suite}
12430
12410
  */
12431
- Suite.prototype.clone = function() {
12411
+ Suite.prototype.clone = function () {
12432
12412
  var suite = new Suite(this.title);
12433
12413
  debug('clone');
12434
12414
  suite.ctx = this.ctx;
@@ -12448,7 +12428,7 @@
12448
12428
  * @param {number|string} ms
12449
12429
  * @return {Suite|number} for chaining
12450
12430
  */
12451
- Suite.prototype.timeout = function(ms) {
12431
+ Suite.prototype.timeout = function (ms) {
12452
12432
  if (!arguments.length) {
12453
12433
  return this._timeout;
12454
12434
  }
@@ -12473,7 +12453,7 @@
12473
12453
  * @param {number|string} n
12474
12454
  * @return {Suite|number} for chaining
12475
12455
  */
12476
- Suite.prototype.retries = function(n) {
12456
+ Suite.prototype.retries = function (n) {
12477
12457
  if (!arguments.length) {
12478
12458
  return this._retries;
12479
12459
  }
@@ -12489,7 +12469,7 @@
12489
12469
  * @param {number|string} ms
12490
12470
  * @return {Suite|number} for chaining
12491
12471
  */
12492
- Suite.prototype.slow = function(ms) {
12472
+ Suite.prototype.slow = function (ms) {
12493
12473
  if (!arguments.length) {
12494
12474
  return this._slow;
12495
12475
  }
@@ -12508,7 +12488,7 @@
12508
12488
  * @param {boolean} bail
12509
12489
  * @return {Suite|number} for chaining
12510
12490
  */
12511
- Suite.prototype.bail = function(bail) {
12491
+ Suite.prototype.bail = function (bail) {
12512
12492
  if (!arguments.length) {
12513
12493
  return this._bail;
12514
12494
  }
@@ -12522,7 +12502,7 @@
12522
12502
  *
12523
12503
  * @private
12524
12504
  */
12525
- Suite.prototype.isPending = function() {
12505
+ Suite.prototype.isPending = function () {
12526
12506
  return this.pending || (this.parent && this.parent.isPending());
12527
12507
  };
12528
12508
 
@@ -12533,7 +12513,7 @@
12533
12513
  * @param {Function} fn - Hook callback
12534
12514
  * @returns {Hook} A new hook
12535
12515
  */
12536
- Suite.prototype._createHook = function(title, fn) {
12516
+ Suite.prototype._createHook = function (title, fn) {
12537
12517
  var hook$1 = new hook(title, fn);
12538
12518
  hook$1.parent = this;
12539
12519
  hook$1.timeout(this.timeout());
@@ -12552,7 +12532,7 @@
12552
12532
  * @param {Function} fn
12553
12533
  * @return {Suite} for chaining
12554
12534
  */
12555
- Suite.prototype.beforeAll = function(title, fn) {
12535
+ Suite.prototype.beforeAll = function (title, fn) {
12556
12536
  if (this.isPending()) {
12557
12537
  return this;
12558
12538
  }
@@ -12576,7 +12556,7 @@
12576
12556
  * @param {Function} fn
12577
12557
  * @return {Suite} for chaining
12578
12558
  */
12579
- Suite.prototype.afterAll = function(title, fn) {
12559
+ Suite.prototype.afterAll = function (title, fn) {
12580
12560
  if (this.isPending()) {
12581
12561
  return this;
12582
12562
  }
@@ -12600,7 +12580,7 @@
12600
12580
  * @param {Function} fn
12601
12581
  * @return {Suite} for chaining
12602
12582
  */
12603
- Suite.prototype.beforeEach = function(title, fn) {
12583
+ Suite.prototype.beforeEach = function (title, fn) {
12604
12584
  if (this.isPending()) {
12605
12585
  return this;
12606
12586
  }
@@ -12624,7 +12604,7 @@
12624
12604
  * @param {Function} fn
12625
12605
  * @return {Suite} for chaining
12626
12606
  */
12627
- Suite.prototype.afterEach = function(title, fn) {
12607
+ Suite.prototype.afterEach = function (title, fn) {
12628
12608
  if (this.isPending()) {
12629
12609
  return this;
12630
12610
  }
@@ -12647,7 +12627,7 @@
12647
12627
  * @param {Suite} suite
12648
12628
  * @return {Suite} for chaining
12649
12629
  */
12650
- Suite.prototype.addSuite = function(suite) {
12630
+ Suite.prototype.addSuite = function (suite) {
12651
12631
  suite.parent = this;
12652
12632
  suite.root = false;
12653
12633
  suite.timeout(this.timeout());
@@ -12666,7 +12646,7 @@
12666
12646
  * @param {Test} test
12667
12647
  * @return {Suite} for chaining
12668
12648
  */
12669
- Suite.prototype.addTest = function(test) {
12649
+ Suite.prototype.addTest = function (test) {
12670
12650
  test.parent = this;
12671
12651
  test.timeout(this.timeout());
12672
12652
  test.retries(this.retries());
@@ -12685,7 +12665,7 @@
12685
12665
  * @public
12686
12666
  * @return {string}
12687
12667
  */
12688
- Suite.prototype.fullTitle = function() {
12668
+ Suite.prototype.fullTitle = function () {
12689
12669
  return this.titlePath().join(' ');
12690
12670
  };
12691
12671
 
@@ -12697,7 +12677,7 @@
12697
12677
  * @public
12698
12678
  * @return {string}
12699
12679
  */
12700
- Suite.prototype.titlePath = function() {
12680
+ Suite.prototype.titlePath = function () {
12701
12681
  var result = [];
12702
12682
  if (this.parent) {
12703
12683
  result = result.concat(this.parent.titlePath());
@@ -12715,9 +12695,9 @@
12715
12695
  * @public
12716
12696
  * @return {number}
12717
12697
  */
12718
- Suite.prototype.total = function() {
12698
+ Suite.prototype.total = function () {
12719
12699
  return (
12720
- this.suites.reduce(function(sum, suite) {
12700
+ this.suites.reduce(function (sum, suite) {
12721
12701
  return sum + suite.total();
12722
12702
  }, 0) + this.tests.length
12723
12703
  );
@@ -12731,9 +12711,9 @@
12731
12711
  * @param {Function} fn
12732
12712
  * @return {Suite}
12733
12713
  */
12734
- Suite.prototype.eachTest = function(fn) {
12714
+ Suite.prototype.eachTest = function (fn) {
12735
12715
  this.tests.forEach(fn);
12736
- this.suites.forEach(function(suite) {
12716
+ this.suites.forEach(function (suite) {
12737
12717
  suite.eachTest(fn);
12738
12718
  });
12739
12719
  return this;
@@ -12759,7 +12739,7 @@
12759
12739
  return (
12760
12740
  this._onlyTests.length > 0 ||
12761
12741
  this._onlySuites.length > 0 ||
12762
- this.suites.some(function(suite) {
12742
+ this.suites.some(function (suite) {
12763
12743
  return suite.hasOnly();
12764
12744
  })
12765
12745
  );
@@ -12779,7 +12759,7 @@
12779
12759
  } else {
12780
12760
  // Otherwise, do not run any of the tests in this suite.
12781
12761
  this.tests = [];
12782
- this._onlySuites.forEach(function(onlySuite) {
12762
+ this._onlySuites.forEach(function (onlySuite) {
12783
12763
  // If there are other `only` tests/suites nested in the current `only` suite, then filter that `only` suite.
12784
12764
  // Otherwise, all of the tests on this `only` suite should be run, so don't filter it.
12785
12765
  if (onlySuite.hasOnly()) {
@@ -12788,7 +12768,7 @@
12788
12768
  });
12789
12769
  // Run the `only` suites, as well as any other suites that have `only` tests/suites as descendants.
12790
12770
  var onlySuites = this._onlySuites;
12791
- this.suites = this.suites.filter(function(childSuite) {
12771
+ this.suites = this.suites.filter(function (childSuite) {
12792
12772
  return onlySuites.indexOf(childSuite) !== -1 || childSuite.filterOnly();
12793
12773
  });
12794
12774
  }
@@ -12802,7 +12782,7 @@
12802
12782
  * @private
12803
12783
  * @param {Suite} suite
12804
12784
  */
12805
- Suite.prototype.appendOnlySuite = function(suite) {
12785
+ Suite.prototype.appendOnlySuite = function (suite) {
12806
12786
  this._onlySuites.push(suite);
12807
12787
  };
12808
12788
 
@@ -12811,7 +12791,7 @@
12811
12791
  *
12812
12792
  * @private
12813
12793
  */
12814
- Suite.prototype.markOnly = function() {
12794
+ Suite.prototype.markOnly = function () {
12815
12795
  this.parent && this.parent.appendOnlySuite(this);
12816
12796
  };
12817
12797
 
@@ -12821,7 +12801,7 @@
12821
12801
  * @private
12822
12802
  * @param {Test} test
12823
12803
  */
12824
- Suite.prototype.appendOnlyTest = function(test) {
12804
+ Suite.prototype.appendOnlyTest = function (test) {
12825
12805
  this._onlyTests.push(test);
12826
12806
  };
12827
12807
 
@@ -12836,8 +12816,8 @@
12836
12816
  /**
12837
12817
  * cleans all references from this suite and all child suites.
12838
12818
  */
12839
- Suite.prototype.dispose = function() {
12840
- this.suites.forEach(function(suite) {
12819
+ Suite.prototype.dispose = function () {
12820
+ this.suites.forEach(function (suite) {
12841
12821
  suite.dispose();
12842
12822
  });
12843
12823
  this.cleanReferences();
@@ -12911,7 +12891,7 @@
12911
12891
  */
12912
12892
  {
12913
12893
  /**
12914
- * Event emitted after a test file has been loaded Not emitted in browser.
12894
+ * Event emitted after a test file has been loaded. Not emitted in browser.
12915
12895
  */
12916
12896
  EVENT_FILE_POST_REQUIRE: 'post-require',
12917
12897
  /**
@@ -12923,72 +12903,54 @@
12923
12903
  */
12924
12904
  EVENT_FILE_REQUIRE: 'require',
12925
12905
  /**
12926
- * Event emitted when `global.run()` is called (use with `delay` option)
12906
+ * Event emitted when `global.run()` is called (use with `delay` option).
12927
12907
  */
12928
12908
  EVENT_ROOT_SUITE_RUN: 'run',
12929
12909
 
12930
12910
  /**
12931
- * Namespace for collection of a `Suite`'s "after all" hooks
12911
+ * Namespace for collection of a `Suite`'s "after all" hooks.
12932
12912
  */
12933
12913
  HOOK_TYPE_AFTER_ALL: 'afterAll',
12934
12914
  /**
12935
- * Namespace for collection of a `Suite`'s "after each" hooks
12915
+ * Namespace for collection of a `Suite`'s "after each" hooks.
12936
12916
  */
12937
12917
  HOOK_TYPE_AFTER_EACH: 'afterEach',
12938
12918
  /**
12939
- * Namespace for collection of a `Suite`'s "before all" hooks
12919
+ * Namespace for collection of a `Suite`'s "before all" hooks.
12940
12920
  */
12941
12921
  HOOK_TYPE_BEFORE_ALL: 'beforeAll',
12942
12922
  /**
12943
- * Namespace for collection of a `Suite`'s "before all" hooks
12923
+ * Namespace for collection of a `Suite`'s "before each" hooks.
12944
12924
  */
12945
12925
  HOOK_TYPE_BEFORE_EACH: 'beforeEach',
12946
12926
 
12947
- // the following events are all deprecated
12948
-
12949
12927
  /**
12950
- * Emitted after an "after all" `Hook` has been added to a `Suite`. Deprecated
12928
+ * Emitted after a child `Suite` has been added to a `Suite`.
12929
+ */
12930
+ EVENT_SUITE_ADD_SUITE: 'suite',
12931
+ /**
12932
+ * Emitted after an "after all" `Hook` has been added to a `Suite`.
12951
12933
  */
12952
12934
  EVENT_SUITE_ADD_HOOK_AFTER_ALL: 'afterAll',
12953
12935
  /**
12954
- * Emitted after an "after each" `Hook` has been added to a `Suite` Deprecated
12936
+ * Emitted after an "after each" `Hook` has been added to a `Suite`.
12955
12937
  */
12956
12938
  EVENT_SUITE_ADD_HOOK_AFTER_EACH: 'afterEach',
12957
12939
  /**
12958
- * Emitted after an "before all" `Hook` has been added to a `Suite` Deprecated
12940
+ * Emitted after an "before all" `Hook` has been added to a `Suite`.
12959
12941
  */
12960
12942
  EVENT_SUITE_ADD_HOOK_BEFORE_ALL: 'beforeAll',
12961
12943
  /**
12962
- * Emitted after an "before each" `Hook` has been added to a `Suite` Deprecated
12944
+ * Emitted after an "before each" `Hook` has been added to a `Suite`.
12963
12945
  */
12964
12946
  EVENT_SUITE_ADD_HOOK_BEFORE_EACH: 'beforeEach',
12965
12947
  /**
12966
- * Emitted after a child `Suite` has been added to a `Suite`. Deprecated
12967
- */
12968
- EVENT_SUITE_ADD_SUITE: 'suite',
12969
- /**
12970
- * Emitted after a `Test` has been added to a `Suite`. Deprecated
12948
+ * Emitted after a `Test` has been added to a `Suite`.
12971
12949
  */
12972
12950
  EVENT_SUITE_ADD_TEST: 'test'
12973
12951
  }
12974
12952
  );
12975
12953
 
12976
- /**
12977
- * @summary There are no known use cases for these events.
12978
- * @desc This is a `Set`-like object having all keys being the constant's string value and the value being `true`.
12979
- * @todo Remove eventually
12980
- * @type {Object<string,boolean>}
12981
- * @ignore
12982
- */
12983
- var deprecatedEvents = Object.keys(constants)
12984
- .filter(function(constant) {
12985
- return constant.substring(0, 15) === 'EVENT_SUITE_ADD';
12986
- })
12987
- .reduce(function(acc, constant) {
12988
- acc[constants[constant]] = true;
12989
- return acc;
12990
- }, createMap());
12991
-
12992
12954
  Suite.constants = constants;
12993
12955
  });
12994
12956
 
@@ -13131,7 +13093,7 @@
13131
13093
  * @param {boolean} [opts.cleanReferencesAfterRun] - Whether to clean references to test fns and hooks when a suite is done.
13132
13094
  * @param {boolean} [opts.delay] - Whether to delay execution of root suite until ready.
13133
13095
  * @param {boolean} [opts.dryRun] - Whether to report tests without running them.
13134
- * @param {boolean} [options.failZero] - Whether to fail test run if zero tests encountered.
13096
+ * @param {boolean} [opts.failZero] - Whether to fail test run if zero tests encountered.
13135
13097
  */
13136
13098
  constructor(suite, opts) {
13137
13099
  super();
@@ -13160,7 +13122,7 @@
13160
13122
  * @type {Map<EventEmitter,Map<string,Set<EventListener>>>}
13161
13123
  */
13162
13124
  this._eventListeners = new Map();
13163
- this.on(constants$1.EVENT_TEST_END, function(test) {
13125
+ this.on(constants$1.EVENT_TEST_END, function (test) {
13164
13126
  if (test.type === 'test' && test.retriedTest() && test.parent) {
13165
13127
  var idx =
13166
13128
  test.parent.tests && test.parent.tests.indexOf(test.retriedTest());
@@ -13168,7 +13130,7 @@
13168
13130
  }
13169
13131
  self.checkGlobals(test);
13170
13132
  });
13171
- this.on(constants$1.EVENT_HOOK_END, function(hook) {
13133
+ this.on(constants$1.EVENT_HOOK_END, function (hook) {
13172
13134
  self.checkGlobals(hook);
13173
13135
  });
13174
13136
  this._defaultGrep = /.*/;
@@ -13217,7 +13179,7 @@
13217
13179
  * @param {string} fn - Listener function
13218
13180
  * @private
13219
13181
  */
13220
- Runner.prototype._addEventListener = function(target, eventName, listener) {
13182
+ Runner.prototype._addEventListener = function (target, eventName, listener) {
13221
13183
  debug(
13222
13184
  '_addEventListener(): adding for event %s; %d current listeners',
13223
13185
  eventName,
@@ -13227,10 +13189,7 @@
13227
13189
  if (
13228
13190
  this._eventListeners.has(target) &&
13229
13191
  this._eventListeners.get(target).has(eventName) &&
13230
- this._eventListeners
13231
- .get(target)
13232
- .get(eventName)
13233
- .has(listener)
13192
+ this._eventListeners.get(target).get(eventName).has(listener)
13234
13193
  ) {
13235
13194
  debug(
13236
13195
  'warning: tried to attach duplicate event listener for %s',
@@ -13257,7 +13216,7 @@
13257
13216
  * @param {function} listener - Listener function
13258
13217
  * @private
13259
13218
  */
13260
- Runner.prototype._removeEventListener = function(target, eventName, listener) {
13219
+ Runner.prototype._removeEventListener = function (target, eventName, listener) {
13261
13220
  target.removeListener(eventName, listener);
13262
13221
 
13263
13222
  if (this._eventListeners.has(target)) {
@@ -13281,7 +13240,7 @@
13281
13240
  * Removes all event handlers set during a run on this instance.
13282
13241
  * Remark: this does _not_ clean/dispose the tests or suites themselves.
13283
13242
  */
13284
- Runner.prototype.dispose = function() {
13243
+ Runner.prototype.dispose = function () {
13285
13244
  this.removeAllListeners();
13286
13245
  this._eventListeners.forEach((targetListeners, target) => {
13287
13246
  targetListeners.forEach((targetEventListeners, eventName) => {
@@ -13303,7 +13262,7 @@
13303
13262
  * @param {boolean} invert
13304
13263
  * @return {Runner} Runner instance.
13305
13264
  */
13306
- Runner.prototype.grep = function(re, invert) {
13265
+ Runner.prototype.grep = function (re, invert) {
13307
13266
  debug('grep(): setting to %s', re);
13308
13267
  this._grep = re;
13309
13268
  this._invert = invert;
@@ -13320,11 +13279,11 @@
13320
13279
  * @param {Suite} suite
13321
13280
  * @return {number}
13322
13281
  */
13323
- Runner.prototype.grepTotal = function(suite) {
13282
+ Runner.prototype.grepTotal = function (suite) {
13324
13283
  var self = this;
13325
13284
  var total = 0;
13326
13285
 
13327
- suite.eachTest(function(test) {
13286
+ suite.eachTest(function (test) {
13328
13287
  var match = self._grep.test(test.fullTitle());
13329
13288
  if (self._invert) {
13330
13289
  match = !match;
@@ -13343,7 +13302,7 @@
13343
13302
  * @return {Array}
13344
13303
  * @private
13345
13304
  */
13346
- Runner.prototype.globalProps = function() {
13305
+ Runner.prototype.globalProps = function () {
13347
13306
  var props = Object.keys(commonjsGlobal);
13348
13307
 
13349
13308
  // non-enumerables
@@ -13365,7 +13324,7 @@
13365
13324
  * @param {Array} arr
13366
13325
  * @return {Runner} Runner instance.
13367
13326
  */
13368
- Runner.prototype.globals = function(arr) {
13327
+ Runner.prototype.globals = function (arr) {
13369
13328
  if (!arguments.length) {
13370
13329
  return this._globals;
13371
13330
  }
@@ -13379,7 +13338,7 @@
13379
13338
  *
13380
13339
  * @private
13381
13340
  */
13382
- Runner.prototype.checkGlobals = function(test) {
13341
+ Runner.prototype.checkGlobals = function (test) {
13383
13342
  if (!this.checkLeaks) {
13384
13343
  return;
13385
13344
  }
@@ -13427,7 +13386,7 @@
13427
13386
  * @param {Error} err
13428
13387
  * @param {boolean} [force=false] - Whether to fail a pending test.
13429
13388
  */
13430
- Runner.prototype.fail = function(test, err, force) {
13389
+ Runner.prototype.fail = function (test, err, force) {
13431
13390
  force = force === true;
13432
13391
  if (test.isPending() && !force) {
13433
13392
  return;
@@ -13468,7 +13427,7 @@
13468
13427
  * @param {Function} fn
13469
13428
  */
13470
13429
 
13471
- Runner.prototype.hook = function(name, fn) {
13430
+ Runner.prototype.hook = function (name, fn) {
13472
13431
  if (this._opts.dryRun) return fn();
13473
13432
 
13474
13433
  var suite = this.suite;
@@ -13497,7 +13456,7 @@
13497
13456
  self.emit(constants$1.EVENT_HOOK_BEGIN, hook);
13498
13457
 
13499
13458
  if (!hook.listeners('error').length) {
13500
- self._addEventListener(hook, 'error', function(err) {
13459
+ self._addEventListener(hook, 'error', function (err) {
13501
13460
  self.fail(hook, err);
13502
13461
  });
13503
13462
  }
@@ -13522,10 +13481,10 @@
13522
13481
  hook.pending = false; // activates hook for next test
13523
13482
  return fn(new Error('abort hookDown'));
13524
13483
  } else if (name === HOOK_TYPE_BEFORE_ALL) {
13525
- suite.tests.forEach(function(test) {
13484
+ suite.tests.forEach(function (test) {
13526
13485
  test.pending = true;
13527
13486
  });
13528
- suite.suites.forEach(function(suite) {
13487
+ suite.suites.forEach(function (suite) {
13529
13488
  suite.pending = true;
13530
13489
  });
13531
13490
  hooks = [];
@@ -13562,7 +13521,7 @@
13562
13521
  }
13563
13522
  }
13564
13523
 
13565
- Runner.immediately(function() {
13524
+ Runner.immediately(function () {
13566
13525
  next(0);
13567
13526
  });
13568
13527
  };
@@ -13576,7 +13535,7 @@
13576
13535
  * @param {Array} suites
13577
13536
  * @param {Function} fn
13578
13537
  */
13579
- Runner.prototype.hooks = function(name, suites, fn) {
13538
+ Runner.prototype.hooks = function (name, suites, fn) {
13580
13539
  var self = this;
13581
13540
  var orig = this.suite;
13582
13541
 
@@ -13588,7 +13547,7 @@
13588
13547
  return fn();
13589
13548
  }
13590
13549
 
13591
- self.hook(name, function(err) {
13550
+ self.hook(name, function (err) {
13592
13551
  if (err) {
13593
13552
  var errSuite = self.suite;
13594
13553
  self.suite = orig;
@@ -13609,7 +13568,7 @@
13609
13568
  * @param {Function} fn
13610
13569
  * @private
13611
13570
  */
13612
- Runner.prototype.hookUp = function(name, fn) {
13571
+ Runner.prototype.hookUp = function (name, fn) {
13613
13572
  var suites = [this.suite].concat(this.parents()).reverse();
13614
13573
  this.hooks(name, suites, fn);
13615
13574
  };
@@ -13621,7 +13580,7 @@
13621
13580
  * @param {Function} fn
13622
13581
  * @private
13623
13582
  */
13624
- Runner.prototype.hookDown = function(name, fn) {
13583
+ Runner.prototype.hookDown = function (name, fn) {
13625
13584
  var suites = [this.suite].concat(this.parents());
13626
13585
  this.hooks(name, suites, fn);
13627
13586
  };
@@ -13633,7 +13592,7 @@
13633
13592
  * @return {Array}
13634
13593
  * @private
13635
13594
  */
13636
- Runner.prototype.parents = function() {
13595
+ Runner.prototype.parents = function () {
13637
13596
  var suite = this.suite;
13638
13597
  var suites = [];
13639
13598
  while (suite.parent) {
@@ -13649,7 +13608,7 @@
13649
13608
  * @param {Function} fn
13650
13609
  * @private
13651
13610
  */
13652
- Runner.prototype.runTest = function(fn) {
13611
+ Runner.prototype.runTest = function (fn) {
13653
13612
  if (this._opts.dryRun) return fn();
13654
13613
 
13655
13614
  var self = this;
@@ -13662,7 +13621,7 @@
13662
13621
  if (this.asyncOnly) {
13663
13622
  test.asyncOnly = true;
13664
13623
  }
13665
- this._addEventListener(test, 'error', function(err) {
13624
+ this._addEventListener(test, 'error', function (err) {
13666
13625
  self.fail(test, err);
13667
13626
  });
13668
13627
  if (this.allowUncaught) {
@@ -13683,7 +13642,7 @@
13683
13642
  * @param {Suite} suite
13684
13643
  * @param {Function} fn
13685
13644
  */
13686
- Runner.prototype.runTests = function(suite, fn) {
13645
+ Runner.prototype.runTests = function (suite, fn) {
13687
13646
  var self = this;
13688
13647
  var tests = suite.tests.slice();
13689
13648
  var test;
@@ -13697,7 +13656,7 @@
13697
13656
  self.suite = after ? errSuite.parent : errSuite;
13698
13657
 
13699
13658
  if (self.suite) {
13700
- self.hookUp(HOOK_TYPE_AFTER_EACH, function(err2, errSuite2) {
13659
+ self.hookUp(HOOK_TYPE_AFTER_EACH, function (err2, errSuite2) {
13701
13660
  self.suite = orig;
13702
13661
  // some hooks may fail even now
13703
13662
  if (err2) {
@@ -13771,7 +13730,7 @@
13771
13730
 
13772
13731
  // execute test and hook(s)
13773
13732
  self.emit(constants$1.EVENT_TEST_BEGIN, (self.test = test));
13774
- self.hookDown(HOOK_TYPE_BEFORE_EACH, function(err, errSuite) {
13733
+ self.hookDown(HOOK_TYPE_BEFORE_EACH, function (err, errSuite) {
13775
13734
  // conditional skip within beforeEach
13776
13735
  if (test.isPending()) {
13777
13736
  if (self.forbidPending) {
@@ -13784,7 +13743,7 @@
13784
13743
  // skip inner afterEach hooks below errSuite level
13785
13744
  var origSuite = self.suite;
13786
13745
  self.suite = errSuite || self.suite;
13787
- return self.hookUp(HOOK_TYPE_AFTER_EACH, function(e, eSuite) {
13746
+ return self.hookUp(HOOK_TYPE_AFTER_EACH, function (e, eSuite) {
13788
13747
  self.suite = origSuite;
13789
13748
  next(e, eSuite);
13790
13749
  });
@@ -13793,7 +13752,7 @@
13793
13752
  return hookErr(err, errSuite, false);
13794
13753
  }
13795
13754
  self.currentRunnable = self.test;
13796
- self.runTest(function(err) {
13755
+ self.runTest(function (err) {
13797
13756
  test = self.test;
13798
13757
  // conditional skip within it
13799
13758
  if (test.pending) {
@@ -13844,7 +13803,7 @@
13844
13803
  * @param {Suite} suite
13845
13804
  * @param {Function} fn
13846
13805
  */
13847
- Runner.prototype.runSuite = function(suite, fn) {
13806
+ Runner.prototype.runSuite = function (suite, fn) {
13848
13807
  var i = 0;
13849
13808
  var self = this;
13850
13809
  var total = this.grepTotal(suite);
@@ -13884,7 +13843,7 @@
13884
13843
  // huge recursive loop and thus a maximum call stack error.
13885
13844
  // See comment in `this.runTests()` for more information.
13886
13845
  if (self._grep !== self._defaultGrep) {
13887
- Runner.immediately(function() {
13846
+ Runner.immediately(function () {
13888
13847
  self.runSuite(curr, next);
13889
13848
  });
13890
13849
  } else {
@@ -13899,7 +13858,7 @@
13899
13858
  // remove reference to test
13900
13859
  delete self.test;
13901
13860
 
13902
- self.hook(HOOK_TYPE_AFTER_ALL, function() {
13861
+ self.hook(HOOK_TYPE_AFTER_ALL, function () {
13903
13862
  self.emit(constants$1.EVENT_SUITE_END, suite);
13904
13863
  fn(errSuite);
13905
13864
  });
@@ -13907,7 +13866,7 @@
13907
13866
 
13908
13867
  this.nextSuite = next;
13909
13868
 
13910
- this.hook(HOOK_TYPE_BEFORE_ALL, function(err) {
13869
+ this.hook(HOOK_TYPE_BEFORE_ALL, function (err) {
13911
13870
  if (err) {
13912
13871
  return done();
13913
13872
  }
@@ -13931,7 +13890,7 @@
13931
13890
  * @param {Error} err - Some uncaught error
13932
13891
  * @private
13933
13892
  */
13934
- Runner.prototype._uncaught = function(err) {
13893
+ Runner.prototype._uncaught = function (err) {
13935
13894
  // this is defensive to prevent future developers from mis-calling this function.
13936
13895
  // it's more likely that it'd be called with the incorrect context--say, the global
13937
13896
  // `process` object--than it would to be called with a context that is not a "subclass"
@@ -14029,12 +13988,12 @@
14029
13988
  * @param {{files: string[], options: Options}} [opts] - For subclasses
14030
13989
  * @returns {Runner} Runner instance.
14031
13990
  */
14032
- Runner.prototype.run = function(fn, opts = {}) {
13991
+ Runner.prototype.run = function (fn, opts = {}) {
14033
13992
  var rootSuite = this.suite;
14034
13993
  var options = opts.options || {};
14035
13994
 
14036
13995
  debug('run(): got options: %O', options);
14037
- fn = fn || function() {};
13996
+ fn = fn || function () {};
14038
13997
 
14039
13998
  const end = () => {
14040
13999
  if (!this.total && this._opts.failZero) this.failures = 1;
@@ -14075,7 +14034,7 @@
14075
14034
  }
14076
14035
 
14077
14036
  // callback
14078
- this.on(constants$1.EVENT_RUN_END, function() {
14037
+ this.on(constants$1.EVENT_RUN_END, function () {
14079
14038
  this.state = constants$1.STATE_STOPPED;
14080
14039
  debug('run(): emitted %s', constants$1.EVENT_RUN_END);
14081
14040
  fn(this.failures);
@@ -14122,7 +14081,7 @@
14122
14081
  * }
14123
14082
  * }
14124
14083
  */
14125
- Runner.prototype.linkPartialObjects = function(value) {
14084
+ Runner.prototype.linkPartialObjects = function (value) {
14126
14085
  return this;
14127
14086
  };
14128
14087
 
@@ -14147,7 +14106,7 @@
14147
14106
  * @public
14148
14107
  * @return {Runner} Runner instance.
14149
14108
  */
14150
- Runner.prototype.abort = function() {
14109
+ Runner.prototype.abort = function () {
14151
14110
  debug('abort(): aborting');
14152
14111
  this._abort = true;
14153
14112
 
@@ -14175,7 +14134,7 @@
14175
14134
  * @chainable
14176
14135
  * @abstract
14177
14136
  */
14178
- Runner.prototype.workerReporter = function() {
14137
+ Runner.prototype.workerReporter = function () {
14179
14138
  throw createUnsupportedError$1('workerReporter() not supported in serial mode');
14180
14139
  };
14181
14140
 
@@ -14188,7 +14147,7 @@
14188
14147
  * @return {Array}
14189
14148
  */
14190
14149
  function filterLeaks(ok, globals) {
14191
- return globals.filter(function(key) {
14150
+ return globals.filter(function (key) {
14192
14151
  // Firefox and Chrome exposes iframes as index inside the window object
14193
14152
  if (/^\d+/.test(key)) {
14194
14153
  return false;
@@ -14212,7 +14171,7 @@
14212
14171
  return false;
14213
14172
  }
14214
14173
 
14215
- var matched = ok.filter(function(ok) {
14174
+ var matched = ok.filter(function (ok) {
14216
14175
  if (~ok.indexOf('*')) {
14217
14176
  return key.indexOf(ok.split('*')[0]) === 0;
14218
14177
  }
@@ -14320,6 +14279,11 @@
14320
14279
 
14321
14280
  exports.inlineDiffs = false;
14322
14281
 
14282
+ /**
14283
+ * Truncate diffs longer than this value to avoid slow performance
14284
+ */
14285
+ exports.maxDiffSize = 8192;
14286
+
14323
14287
  /**
14324
14288
  * Default color map.
14325
14289
  */
@@ -14371,7 +14335,7 @@
14371
14335
  * @param {string} str
14372
14336
  * @return {string}
14373
14337
  */
14374
- var color = (exports.color = function(type, str) {
14338
+ var color = (exports.color = function (type, str) {
14375
14339
  if (!exports.useColors) {
14376
14340
  return String(str);
14377
14341
  }
@@ -14399,23 +14363,23 @@
14399
14363
  */
14400
14364
 
14401
14365
  exports.cursor = {
14402
- hide: function() {
14366
+ hide: function () {
14403
14367
  isatty && process$1.stdout.write('\u001b[?25l');
14404
14368
  },
14405
14369
 
14406
- show: function() {
14370
+ show: function () {
14407
14371
  isatty && process$1.stdout.write('\u001b[?25h');
14408
14372
  },
14409
14373
 
14410
- deleteLine: function() {
14374
+ deleteLine: function () {
14411
14375
  isatty && process$1.stdout.write('\u001b[2K');
14412
14376
  },
14413
14377
 
14414
- beginningOfLine: function() {
14378
+ beginningOfLine: function () {
14415
14379
  isatty && process$1.stdout.write('\u001b[0G');
14416
14380
  },
14417
14381
 
14418
- CR: function() {
14382
+ CR: function () {
14419
14383
  if (isatty) {
14420
14384
  exports.cursor.deleteLine();
14421
14385
  exports.cursor.beginningOfLine();
@@ -14425,7 +14389,7 @@
14425
14389
  }
14426
14390
  };
14427
14391
 
14428
- var showDiff = (exports.showDiff = function(err) {
14392
+ var showDiff = (exports.showDiff = function (err) {
14429
14393
  return (
14430
14394
  err &&
14431
14395
  err.showDiff !== false &&
@@ -14452,18 +14416,23 @@
14452
14416
  * @param {string} expected
14453
14417
  * @return {string} Diff
14454
14418
  */
14455
- var generateDiff = (exports.generateDiff = function(actual, expected) {
14419
+
14420
+ var generateDiff = (exports.generateDiff = function (actual, expected) {
14456
14421
  try {
14457
- const diffSize = 2048;
14458
- if (actual.length > diffSize) {
14459
- actual = actual.substring(0, diffSize) + ' ... Lines skipped';
14460
- }
14461
- if (expected.length > diffSize) {
14462
- expected = expected.substring(0, diffSize) + ' ... Lines skipped';
14463
- }
14464
- return exports.inlineDiffs
14422
+ var maxLen = exports.maxDiffSize;
14423
+ var skipped = 0;
14424
+ if (maxLen > 0) {
14425
+ skipped = Math.max(actual.length - maxLen, expected.length - maxLen);
14426
+ actual = actual.slice(0, maxLen);
14427
+ expected = expected.slice(0, maxLen);
14428
+ }
14429
+ let result = exports.inlineDiffs
14465
14430
  ? inlineDiff(actual, expected)
14466
14431
  : unifiedDiff(actual, expected);
14432
+ if (skipped > 0) {
14433
+ result = `${result}\n [mocha] output truncated to ${maxLen} characters, see "maxDiffSize" reporter-option\n`;
14434
+ }
14435
+ return result;
14467
14436
  } catch (err) {
14468
14437
  var msg =
14469
14438
  '\n ' +
@@ -14484,10 +14453,10 @@
14484
14453
  * @param {Object[]} failures - Each is Test instance with corresponding
14485
14454
  * Error property
14486
14455
  */
14487
- exports.list = function(failures) {
14456
+ exports.list = function (failures) {
14488
14457
  var multipleErr, multipleTest;
14489
14458
  Base.consoleLog();
14490
- failures.forEach(function(test, i) {
14459
+ failures.forEach(function (test, i) {
14491
14460
  // format
14492
14461
  var fmt =
14493
14462
  color('error title', ' %s) %s:\n') +
@@ -14546,7 +14515,7 @@
14546
14515
 
14547
14516
  // indented test title
14548
14517
  var testTitle = '';
14549
- test.titlePath().forEach(function(str, index) {
14518
+ test.titlePath().forEach(function (str, index) {
14550
14519
  if (index !== 0) {
14551
14520
  testTitle += '\n ';
14552
14521
  }
@@ -14582,7 +14551,13 @@
14582
14551
  this.runner = runner;
14583
14552
  this.stats = runner.stats; // assigned so Reporters keep a closer reference
14584
14553
 
14585
- runner.on(EVENT_TEST_PASS, function(test) {
14554
+ var maxDiffSizeOpt =
14555
+ this.options.reporterOption && this.options.reporterOption.maxDiffSize;
14556
+ if (maxDiffSizeOpt !== undefined && !isNaN(Number(maxDiffSizeOpt))) {
14557
+ exports.maxDiffSize = Number(maxDiffSizeOpt);
14558
+ }
14559
+
14560
+ runner.on(EVENT_TEST_PASS, function (test) {
14586
14561
  if (test.duration > test.slow()) {
14587
14562
  test.speed = 'slow';
14588
14563
  } else if (test.duration > test.slow() / 2) {
@@ -14592,7 +14567,7 @@
14592
14567
  }
14593
14568
  });
14594
14569
 
14595
- runner.on(EVENT_TEST_FAIL, function(test, err) {
14570
+ runner.on(EVENT_TEST_FAIL, function (test, err) {
14596
14571
  if (showDiff(err)) {
14597
14572
  stringifyDiffObjs(err);
14598
14573
  }
@@ -14612,7 +14587,7 @@
14612
14587
  * @public
14613
14588
  * @memberof Mocha.reporters
14614
14589
  */
14615
- Base.prototype.epilogue = function() {
14590
+ Base.prototype.epilogue = function () {
14616
14591
  var stats = this.stats;
14617
14592
  var fmt;
14618
14593
 
@@ -14675,7 +14650,7 @@
14675
14650
  if (lines.length > 4) {
14676
14651
  var width = String(lines.length).length;
14677
14652
  msg = lines
14678
- .map(function(str, i) {
14653
+ .map(function (str, i) {
14679
14654
  return pad(++i, width) + ' |' + ' ' + str;
14680
14655
  })
14681
14656
  .join('\n');
@@ -14732,10 +14707,7 @@
14732
14707
  ' ' +
14733
14708
  colorLines('diff removed', '- actual') +
14734
14709
  '\n\n' +
14735
- lines
14736
- .map(cleanUp)
14737
- .filter(notBlank)
14738
- .join('\n')
14710
+ lines.map(cleanUp).filter(notBlank).join('\n')
14739
14711
  );
14740
14712
  }
14741
14713
 
@@ -14750,7 +14722,7 @@
14750
14722
  function errorDiff(actual, expected) {
14751
14723
  return diff$1
14752
14724
  .diffWordsWithSpace(actual, expected)
14753
- .map(function(str) {
14725
+ .map(function (str) {
14754
14726
  if (str.added) {
14755
14727
  return colorLines('diff added inline', str.value);
14756
14728
  }
@@ -14773,7 +14745,7 @@
14773
14745
  function colorLines(name, str) {
14774
14746
  return str
14775
14747
  .split('\n')
14776
- .map(function(str) {
14748
+ .map(function (str) {
14777
14749
  return color(name, str);
14778
14750
  })
14779
14751
  .join('\n');
@@ -14841,18 +14813,18 @@
14841
14813
  var width = (base.window.width * 0.75) | 0;
14842
14814
  var n = -1;
14843
14815
 
14844
- runner.on(EVENT_RUN_BEGIN, function() {
14816
+ runner.on(EVENT_RUN_BEGIN, function () {
14845
14817
  process$1.stdout.write('\n');
14846
14818
  });
14847
14819
 
14848
- runner.on(EVENT_TEST_PENDING, function() {
14820
+ runner.on(EVENT_TEST_PENDING, function () {
14849
14821
  if (++n % width === 0) {
14850
14822
  process$1.stdout.write('\n ');
14851
14823
  }
14852
14824
  process$1.stdout.write(base.color('pending', base.symbols.comma));
14853
14825
  });
14854
14826
 
14855
- runner.on(EVENT_TEST_PASS, function(test) {
14827
+ runner.on(EVENT_TEST_PASS, function (test) {
14856
14828
  if (++n % width === 0) {
14857
14829
  process$1.stdout.write('\n ');
14858
14830
  }
@@ -14863,14 +14835,14 @@
14863
14835
  }
14864
14836
  });
14865
14837
 
14866
- runner.on(EVENT_TEST_FAIL, function() {
14838
+ runner.on(EVENT_TEST_FAIL, function () {
14867
14839
  if (++n % width === 0) {
14868
14840
  process$1.stdout.write('\n ');
14869
14841
  }
14870
14842
  process$1.stdout.write(base.color('fail', base.symbols.bang));
14871
14843
  });
14872
14844
 
14873
- runner.once(EVENT_RUN_END, function() {
14845
+ runner.once(EVENT_RUN_END, function () {
14874
14846
  process$1.stdout.write('\n');
14875
14847
  self.epilogue();
14876
14848
  });
@@ -14925,7 +14897,7 @@
14925
14897
  return Array(indents).join(' ');
14926
14898
  }
14927
14899
 
14928
- runner.on(EVENT_SUITE_BEGIN, function(suite) {
14900
+ runner.on(EVENT_SUITE_BEGIN, function (suite) {
14929
14901
  if (suite.root) {
14930
14902
  return;
14931
14903
  }
@@ -14936,7 +14908,7 @@
14936
14908
  base.consoleLog('%s<dl>', indent());
14937
14909
  });
14938
14910
 
14939
- runner.on(EVENT_SUITE_END, function(suite) {
14911
+ runner.on(EVENT_SUITE_END, function (suite) {
14940
14912
  if (suite.root) {
14941
14913
  return;
14942
14914
  }
@@ -14946,14 +14918,14 @@
14946
14918
  --indents;
14947
14919
  });
14948
14920
 
14949
- runner.on(EVENT_TEST_PASS, function(test) {
14921
+ runner.on(EVENT_TEST_PASS, function (test) {
14950
14922
  base.consoleLog('%s <dt>%s</dt>', indent(), utils.escape(test.title));
14951
14923
  base.consoleLog('%s <dt>%s</dt>', indent(), utils.escape(test.file));
14952
14924
  var code = utils.escape(utils.clean(test.body));
14953
14925
  base.consoleLog('%s <dd><pre><code>%s</code></pre></dd>', indent(), code);
14954
14926
  });
14955
14927
 
14956
- runner.on(EVENT_TEST_FAIL, function(test, err) {
14928
+ runner.on(EVENT_TEST_FAIL, function (test, err) {
14957
14929
  base.consoleLog(
14958
14930
  '%s <dt class="error">%s</dt>',
14959
14931
  indent(),
@@ -15032,27 +15004,27 @@
15032
15004
 
15033
15005
  this._producer = createProducer(tapVersion);
15034
15006
 
15035
- runner.once(EVENT_RUN_BEGIN, function() {
15007
+ runner.once(EVENT_RUN_BEGIN, function () {
15036
15008
  self._producer.writeVersion();
15037
15009
  });
15038
15010
 
15039
- runner.on(EVENT_TEST_END, function() {
15011
+ runner.on(EVENT_TEST_END, function () {
15040
15012
  ++n;
15041
15013
  });
15042
15014
 
15043
- runner.on(EVENT_TEST_PENDING, function(test) {
15015
+ runner.on(EVENT_TEST_PENDING, function (test) {
15044
15016
  self._producer.writePending(n, test);
15045
15017
  });
15046
15018
 
15047
- runner.on(EVENT_TEST_PASS, function(test) {
15019
+ runner.on(EVENT_TEST_PASS, function (test) {
15048
15020
  self._producer.writePass(n, test);
15049
15021
  });
15050
15022
 
15051
- runner.on(EVENT_TEST_FAIL, function(test, err) {
15023
+ runner.on(EVENT_TEST_FAIL, function (test, err) {
15052
15024
  self._producer.writeFail(n, test, err);
15053
15025
  });
15054
15026
 
15055
- runner.once(EVENT_RUN_END, function() {
15027
+ runner.once(EVENT_RUN_END, function () {
15056
15028
  self._producer.writeEpilogue(runner.stats);
15057
15029
  });
15058
15030
  }
@@ -15096,8 +15068,8 @@
15096
15068
  */
15097
15069
  function createProducer(tapVersion) {
15098
15070
  var producers = {
15099
- '12': new TAP12Producer(),
15100
- '13': new TAP13Producer()
15071
+ 12: new TAP12Producer(),
15072
+ 13: new TAP13Producer()
15101
15073
  };
15102
15074
  var producer = producers[tapVersion];
15103
15075
 
@@ -15127,7 +15099,7 @@
15127
15099
  *
15128
15100
  * @abstract
15129
15101
  */
15130
- TAPProducer.prototype.writeVersion = function() {};
15102
+ TAPProducer.prototype.writeVersion = function () {};
15131
15103
 
15132
15104
  /**
15133
15105
  * Writes the plan to reporter output stream.
@@ -15135,7 +15107,7 @@
15135
15107
  * @abstract
15136
15108
  * @param {number} ntests - Number of tests that are planned to run.
15137
15109
  */
15138
- TAPProducer.prototype.writePlan = function(ntests) {
15110
+ TAPProducer.prototype.writePlan = function (ntests) {
15139
15111
  println('%d..%d', 1, ntests);
15140
15112
  };
15141
15113
 
@@ -15146,7 +15118,7 @@
15146
15118
  * @param {number} n - Index of test that passed.
15147
15119
  * @param {Test} test - Instance containing test information.
15148
15120
  */
15149
- TAPProducer.prototype.writePass = function(n, test) {
15121
+ TAPProducer.prototype.writePass = function (n, test) {
15150
15122
  println('ok %d %s', n, title(test));
15151
15123
  };
15152
15124
 
@@ -15157,7 +15129,7 @@
15157
15129
  * @param {number} n - Index of test that was skipped.
15158
15130
  * @param {Test} test - Instance containing test information.
15159
15131
  */
15160
- TAPProducer.prototype.writePending = function(n, test) {
15132
+ TAPProducer.prototype.writePending = function (n, test) {
15161
15133
  println('ok %d %s # SKIP -', n, title(test));
15162
15134
  };
15163
15135
 
@@ -15169,7 +15141,7 @@
15169
15141
  * @param {Test} test - Instance containing test information.
15170
15142
  * @param {Error} err - Reason the test failed.
15171
15143
  */
15172
- TAPProducer.prototype.writeFail = function(n, test, err) {
15144
+ TAPProducer.prototype.writeFail = function (n, test, err) {
15173
15145
  println('not ok %d %s', n, title(test));
15174
15146
  };
15175
15147
 
@@ -15179,7 +15151,7 @@
15179
15151
  * @abstract
15180
15152
  * @param {Object} stats - Object containing run statistics.
15181
15153
  */
15182
- TAPProducer.prototype.writeEpilogue = function(stats) {
15154
+ TAPProducer.prototype.writeEpilogue = function (stats) {
15183
15155
  // :TBD: Why is this not counting pending tests?
15184
15156
  println('# tests ' + (stats.passes + stats.failures));
15185
15157
  println('# pass ' + stats.passes);
@@ -15205,7 +15177,7 @@
15205
15177
  * Writes that test failed to reporter output stream, with error formatting.
15206
15178
  * @override
15207
15179
  */
15208
- this.writeFail = function(n, test, err) {
15180
+ this.writeFail = function (n, test, err) {
15209
15181
  TAPProducer.prototype.writeFail.call(this, n, test, err);
15210
15182
  if (err.message) {
15211
15183
  println(err.message.replace(/^/gm, ' '));
@@ -15238,7 +15210,7 @@
15238
15210
  * Writes the TAP version to reporter output stream.
15239
15211
  * @override
15240
15212
  */
15241
- this.writeVersion = function() {
15213
+ this.writeVersion = function () {
15242
15214
  println('TAP version 13');
15243
15215
  };
15244
15216
 
@@ -15246,7 +15218,7 @@
15246
15218
  * Writes that test failed to reporter output stream, with error formatting.
15247
15219
  * @override
15248
15220
  */
15249
- this.writeFail = function(n, test, err) {
15221
+ this.writeFail = function (n, test, err) {
15250
15222
  TAPProducer.prototype.writeFail.call(this, n, test, err);
15251
15223
  var emitYamlBlock = err.message != null || err.stack != null;
15252
15224
  if (emitYamlBlock) {
@@ -15331,23 +15303,23 @@
15331
15303
  output = options.reporterOption.output;
15332
15304
  }
15333
15305
 
15334
- runner.on(EVENT_TEST_END, function(test) {
15306
+ runner.on(EVENT_TEST_END, function (test) {
15335
15307
  tests.push(test);
15336
15308
  });
15337
15309
 
15338
- runner.on(EVENT_TEST_PASS, function(test) {
15310
+ runner.on(EVENT_TEST_PASS, function (test) {
15339
15311
  passes.push(test);
15340
15312
  });
15341
15313
 
15342
- runner.on(EVENT_TEST_FAIL, function(test) {
15314
+ runner.on(EVENT_TEST_FAIL, function (test) {
15343
15315
  failures.push(test);
15344
15316
  });
15345
15317
 
15346
- runner.on(EVENT_TEST_PENDING, function(test) {
15318
+ runner.on(EVENT_TEST_PENDING, function (test) {
15347
15319
  pending.push(test);
15348
15320
  });
15349
15321
 
15350
- runner.once(EVENT_RUN_END, function() {
15322
+ runner.once(EVENT_RUN_END, function () {
15351
15323
  var obj = {
15352
15324
  stats: self.stats,
15353
15325
  tests: tests.map(clean),
@@ -15410,7 +15382,7 @@
15410
15382
  function cleanCycles(obj) {
15411
15383
  var cache = [];
15412
15384
  return JSON.parse(
15413
- JSON.stringify(obj, function(key, value) {
15385
+ JSON.stringify(obj, function (key, value) {
15414
15386
  if (typeof value === 'object' && value !== null) {
15415
15387
  if (cache.indexOf(value) !== -1) {
15416
15388
  // Instead of going in a circle, we'll print [object Object]
@@ -15433,7 +15405,7 @@
15433
15405
  */
15434
15406
  function errorJSON(err) {
15435
15407
  var res = {};
15436
- Object.getOwnPropertyNames(err).forEach(function(key) {
15408
+ Object.getOwnPropertyNames(err).forEach(function (key) {
15437
15409
  res[key] = err[key];
15438
15410
  }, err);
15439
15411
  return res;
@@ -15469,7 +15441,7 @@
15469
15441
  * @param {number} size
15470
15442
  * @return {Progress} Progress instance.
15471
15443
  */
15472
- Progress.prototype.size = function(size) {
15444
+ Progress.prototype.size = function (size) {
15473
15445
  this._size = size;
15474
15446
  return this;
15475
15447
  };
@@ -15481,7 +15453,7 @@
15481
15453
  * @param {string} text
15482
15454
  * @return {Progress} Progress instance.
15483
15455
  */
15484
- Progress.prototype.text = function(text) {
15456
+ Progress.prototype.text = function (text) {
15485
15457
  this._text = text;
15486
15458
  return this;
15487
15459
  };
@@ -15493,7 +15465,7 @@
15493
15465
  * @param {number} size
15494
15466
  * @return {Progress} Progress instance.
15495
15467
  */
15496
- Progress.prototype.fontSize = function(size) {
15468
+ Progress.prototype.fontSize = function (size) {
15497
15469
  this._fontSize = size;
15498
15470
  return this;
15499
15471
  };
@@ -15504,7 +15476,7 @@
15504
15476
  * @param {string} family
15505
15477
  * @return {Progress} Progress instance.
15506
15478
  */
15507
- Progress.prototype.font = function(family) {
15479
+ Progress.prototype.font = function (family) {
15508
15480
  this._font = family;
15509
15481
  return this;
15510
15482
  };
@@ -15515,7 +15487,7 @@
15515
15487
  * @param {number} n
15516
15488
  * @return {Progress} Progress instance.
15517
15489
  */
15518
- Progress.prototype.update = function(n) {
15490
+ Progress.prototype.update = function (n) {
15519
15491
  this.percent = n;
15520
15492
  return this;
15521
15493
  };
@@ -15526,7 +15498,7 @@
15526
15498
  * @param {CanvasRenderingContext2d} ctx
15527
15499
  * @return {Progress} Progress instance.
15528
15500
  */
15529
- Progress.prototype.draw = function(ctx) {
15501
+ Progress.prototype.draw = function (ctx) {
15530
15502
  try {
15531
15503
  var percent = Math.min(this.percent, 100);
15532
15504
  var size = this._size;
@@ -15657,7 +15629,7 @@
15657
15629
  }
15658
15630
 
15659
15631
  // pass toggle
15660
- on(passesLink, 'click', function(evt) {
15632
+ on(passesLink, 'click', function (evt) {
15661
15633
  evt.preventDefault();
15662
15634
  unhide();
15663
15635
  var name = /pass/.test(report.className) ? '' : ' pass';
@@ -15668,7 +15640,7 @@
15668
15640
  });
15669
15641
 
15670
15642
  // failure toggle
15671
- on(failuresLink, 'click', function(evt) {
15643
+ on(failuresLink, 'click', function (evt) {
15672
15644
  evt.preventDefault();
15673
15645
  unhide();
15674
15646
  var name = /fail/.test(report.className) ? '' : ' fail';
@@ -15685,7 +15657,7 @@
15685
15657
  progress.size(40);
15686
15658
  }
15687
15659
 
15688
- runner.on(EVENT_SUITE_BEGIN, function(suite) {
15660
+ runner.on(EVENT_SUITE_BEGIN, function (suite) {
15689
15661
  if (suite.root) {
15690
15662
  return;
15691
15663
  }
@@ -15704,7 +15676,7 @@
15704
15676
  el.appendChild(stack[0]);
15705
15677
  });
15706
15678
 
15707
- runner.on(EVENT_SUITE_END, function(suite) {
15679
+ runner.on(EVENT_SUITE_END, function (suite) {
15708
15680
  if (suite.root) {
15709
15681
  updateStats();
15710
15682
  return;
@@ -15712,7 +15684,7 @@
15712
15684
  stack.shift();
15713
15685
  });
15714
15686
 
15715
- runner.on(EVENT_TEST_PASS, function(test) {
15687
+ runner.on(EVENT_TEST_PASS, function (test) {
15716
15688
  var url = self.testURL(test);
15717
15689
  var markup =
15718
15690
  '<li class="test pass %e"><h2>%e<span class="duration">%ems</span> ' +
@@ -15725,7 +15697,7 @@
15725
15697
  updateStats();
15726
15698
  });
15727
15699
 
15728
- runner.on(EVENT_TEST_FAIL, function(test) {
15700
+ runner.on(EVENT_TEST_FAIL, function (test) {
15729
15701
  var el = fragment(
15730
15702
  '<li class="test fail"><h2>%e <a href="%e" class="replay">' +
15731
15703
  playIcon +
@@ -15781,7 +15753,7 @@
15781
15753
  updateStats();
15782
15754
  });
15783
15755
 
15784
- runner.on(EVENT_TEST_PENDING, function(test) {
15756
+ runner.on(EVENT_TEST_PENDING, function (test) {
15785
15757
  var el = fragment(
15786
15758
  '<li class="test pass pending"><h2>%e</h2></li>',
15787
15759
  test.title
@@ -15839,7 +15811,7 @@
15839
15811
  *
15840
15812
  * @param {Object} [suite]
15841
15813
  */
15842
- HTML.prototype.suiteURL = function(suite) {
15814
+ HTML.prototype.suiteURL = function (suite) {
15843
15815
  return makeUrl(suite.fullTitle());
15844
15816
  };
15845
15817
 
@@ -15848,7 +15820,7 @@
15848
15820
  *
15849
15821
  * @param {Object} [test]
15850
15822
  */
15851
- HTML.prototype.testURL = function(test) {
15823
+ HTML.prototype.testURL = function (test) {
15852
15824
  return makeUrl(test.fullTitle());
15853
15825
  };
15854
15826
 
@@ -15858,10 +15830,10 @@
15858
15830
  * @param {HTMLLIElement} el
15859
15831
  * @param {string} contents
15860
15832
  */
15861
- HTML.prototype.addCodeToggle = function(el, contents) {
15833
+ HTML.prototype.addCodeToggle = function (el, contents) {
15862
15834
  var h2 = el.getElementsByTagName('h2')[0];
15863
15835
 
15864
- on(h2, 'click', function() {
15836
+ on(h2, 'click', function () {
15865
15837
  pre.style.display = pre.style.display === 'none' ? 'block' : 'none';
15866
15838
  });
15867
15839
 
@@ -15889,7 +15861,7 @@
15889
15861
  var div = document.createElement('div');
15890
15862
  var i = 1;
15891
15863
 
15892
- div.innerHTML = html.replace(/%([se])/g, function(_, type) {
15864
+ div.innerHTML = html.replace(/%([se])/g, function (_, type) {
15893
15865
  switch (type) {
15894
15866
  case 's':
15895
15867
  return String(args[i++]);
@@ -15998,20 +15970,20 @@
15998
15970
  var self = this;
15999
15971
  var n = 0;
16000
15972
 
16001
- runner.on(EVENT_RUN_BEGIN, function() {
15973
+ runner.on(EVENT_RUN_BEGIN, function () {
16002
15974
  base.consoleLog();
16003
15975
  });
16004
15976
 
16005
- runner.on(EVENT_TEST_BEGIN, function(test) {
15977
+ runner.on(EVENT_TEST_BEGIN, function (test) {
16006
15978
  process$1.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
16007
15979
  });
16008
15980
 
16009
- runner.on(EVENT_TEST_PENDING, function(test) {
15981
+ runner.on(EVENT_TEST_PENDING, function (test) {
16010
15982
  var fmt = color('checkmark', ' -') + color('pending', ' %s');
16011
15983
  base.consoleLog(fmt, test.fullTitle());
16012
15984
  });
16013
15985
 
16014
- runner.on(EVENT_TEST_PASS, function(test) {
15986
+ runner.on(EVENT_TEST_PASS, function (test) {
16015
15987
  var fmt =
16016
15988
  color('checkmark', ' ' + base.symbols.ok) +
16017
15989
  color('pass', ' %s: ') +
@@ -16020,7 +15992,7 @@
16020
15992
  base.consoleLog(fmt, test.fullTitle(), test.duration);
16021
15993
  });
16022
15994
 
16023
- runner.on(EVENT_TEST_FAIL, function(test) {
15995
+ runner.on(EVENT_TEST_FAIL, function (test) {
16024
15996
  cursor.CR();
16025
15997
  base.consoleLog(color('fail', ' %d) %s'), ++n, test.fullTitle());
16026
15998
  });
@@ -16072,7 +16044,7 @@
16072
16044
  function Min(runner, options) {
16073
16045
  base.call(this, runner, options);
16074
16046
 
16075
- runner.on(EVENT_RUN_BEGIN, function() {
16047
+ runner.on(EVENT_RUN_BEGIN, function () {
16076
16048
  // clear screen
16077
16049
  process$1.stdout.write('\u001b[2J');
16078
16050
  // set cursor position
@@ -16137,28 +16109,28 @@
16137
16109
  return Array(indents).join(' ');
16138
16110
  }
16139
16111
 
16140
- runner.on(EVENT_RUN_BEGIN, function() {
16112
+ runner.on(EVENT_RUN_BEGIN, function () {
16141
16113
  base.consoleLog();
16142
16114
  });
16143
16115
 
16144
- runner.on(EVENT_SUITE_BEGIN, function(suite) {
16116
+ runner.on(EVENT_SUITE_BEGIN, function (suite) {
16145
16117
  ++indents;
16146
16118
  base.consoleLog(color('suite', '%s%s'), indent(), suite.title);
16147
16119
  });
16148
16120
 
16149
- runner.on(EVENT_SUITE_END, function() {
16121
+ runner.on(EVENT_SUITE_END, function () {
16150
16122
  --indents;
16151
16123
  if (indents === 1) {
16152
16124
  base.consoleLog();
16153
16125
  }
16154
16126
  });
16155
16127
 
16156
- runner.on(EVENT_TEST_PENDING, function(test) {
16128
+ runner.on(EVENT_TEST_PENDING, function (test) {
16157
16129
  var fmt = indent() + color('pending', ' - %s');
16158
16130
  base.consoleLog(fmt, test.title);
16159
16131
  });
16160
16132
 
16161
- runner.on(EVENT_TEST_PASS, function(test) {
16133
+ runner.on(EVENT_TEST_PASS, function (test) {
16162
16134
  var fmt;
16163
16135
  if (test.speed === 'fast') {
16164
16136
  fmt =
@@ -16176,7 +16148,7 @@
16176
16148
  }
16177
16149
  });
16178
16150
 
16179
- runner.on(EVENT_TEST_FAIL, function(test) {
16151
+ runner.on(EVENT_TEST_FAIL, function (test) {
16180
16152
  base.consoleLog(indent() + color('fail', ' %d) %s'), ++n, test.title);
16181
16153
  });
16182
16154
 
@@ -16239,24 +16211,24 @@
16239
16211
  this.trajectories = [[], [], [], []];
16240
16212
  this.trajectoryWidthMax = width - nyanCatWidth;
16241
16213
 
16242
- runner.on(EVENT_RUN_BEGIN, function() {
16214
+ runner.on(EVENT_RUN_BEGIN, function () {
16243
16215
  base.cursor.hide();
16244
16216
  self.draw();
16245
16217
  });
16246
16218
 
16247
- runner.on(EVENT_TEST_PENDING, function() {
16219
+ runner.on(EVENT_TEST_PENDING, function () {
16248
16220
  self.draw();
16249
16221
  });
16250
16222
 
16251
- runner.on(EVENT_TEST_PASS, function() {
16223
+ runner.on(EVENT_TEST_PASS, function () {
16252
16224
  self.draw();
16253
16225
  });
16254
16226
 
16255
- runner.on(EVENT_TEST_FAIL, function() {
16227
+ runner.on(EVENT_TEST_FAIL, function () {
16256
16228
  self.draw();
16257
16229
  });
16258
16230
 
16259
- runner.once(EVENT_RUN_END, function() {
16231
+ runner.once(EVENT_RUN_END, function () {
16260
16232
  base.cursor.show();
16261
16233
  for (var i = 0; i < self.numberOfLines; i++) {
16262
16234
  write('\n');
@@ -16276,7 +16248,7 @@
16276
16248
  * @private
16277
16249
  */
16278
16250
 
16279
- NyanCat.prototype.draw = function() {
16251
+ NyanCat.prototype.draw = function () {
16280
16252
  this.appendRainbow();
16281
16253
  this.drawScoreboard();
16282
16254
  this.drawRainbow();
@@ -16291,7 +16263,7 @@
16291
16263
  * @private
16292
16264
  */
16293
16265
 
16294
- NyanCat.prototype.drawScoreboard = function() {
16266
+ NyanCat.prototype.drawScoreboard = function () {
16295
16267
  var stats = this.stats;
16296
16268
 
16297
16269
  function draw(type, n) {
@@ -16314,7 +16286,7 @@
16314
16286
  * @private
16315
16287
  */
16316
16288
 
16317
- NyanCat.prototype.appendRainbow = function() {
16289
+ NyanCat.prototype.appendRainbow = function () {
16318
16290
  var segment = this.tick ? '_' : '-';
16319
16291
  var rainbowified = this.rainbowify(segment);
16320
16292
 
@@ -16333,10 +16305,10 @@
16333
16305
  * @private
16334
16306
  */
16335
16307
 
16336
- NyanCat.prototype.drawRainbow = function() {
16308
+ NyanCat.prototype.drawRainbow = function () {
16337
16309
  var self = this;
16338
16310
 
16339
- this.trajectories.forEach(function(line) {
16311
+ this.trajectories.forEach(function (line) {
16340
16312
  write('\u001b[' + self.scoreboardWidth + 'C');
16341
16313
  write(line.join(''));
16342
16314
  write('\n');
@@ -16350,7 +16322,7 @@
16350
16322
  *
16351
16323
  * @private
16352
16324
  */
16353
- NyanCat.prototype.drawNyanCat = function() {
16325
+ NyanCat.prototype.drawNyanCat = function () {
16354
16326
  var self = this;
16355
16327
  var startWidth = this.scoreboardWidth + this.trajectories[0].length;
16356
16328
  var dist = '\u001b[' + startWidth + 'C';
@@ -16386,7 +16358,7 @@
16386
16358
  * @return {string}
16387
16359
  */
16388
16360
 
16389
- NyanCat.prototype.face = function() {
16361
+ NyanCat.prototype.face = function () {
16390
16362
  var stats = this.stats;
16391
16363
  if (stats.failures) {
16392
16364
  return '( x .x)';
@@ -16405,7 +16377,7 @@
16405
16377
  * @param {number} n
16406
16378
  */
16407
16379
 
16408
- NyanCat.prototype.cursorUp = function(n) {
16380
+ NyanCat.prototype.cursorUp = function (n) {
16409
16381
  write('\u001b[' + n + 'A');
16410
16382
  };
16411
16383
 
@@ -16416,7 +16388,7 @@
16416
16388
  * @param {number} n
16417
16389
  */
16418
16390
 
16419
- NyanCat.prototype.cursorDown = function(n) {
16391
+ NyanCat.prototype.cursorDown = function (n) {
16420
16392
  write('\u001b[' + n + 'B');
16421
16393
  };
16422
16394
 
@@ -16426,7 +16398,7 @@
16426
16398
  * @private
16427
16399
  * @return {Array}
16428
16400
  */
16429
- NyanCat.prototype.generateColors = function() {
16401
+ NyanCat.prototype.generateColors = function () {
16430
16402
  var colors = [];
16431
16403
 
16432
16404
  for (var i = 0; i < 6 * 7; i++) {
@@ -16448,7 +16420,7 @@
16448
16420
  * @param {string} str
16449
16421
  * @return {string}
16450
16422
  */
16451
- NyanCat.prototype.rainbowify = function(str) {
16423
+ NyanCat.prototype.rainbowify = function (str) {
16452
16424
  if (!base.useColors) {
16453
16425
  return str;
16454
16426
  }
@@ -16540,19 +16512,19 @@
16540
16512
  // fall back to the default suite name
16541
16513
  suiteName = suiteName || DEFAULT_SUITE_NAME;
16542
16514
 
16543
- runner.on(EVENT_TEST_PENDING, function(test) {
16515
+ runner.on(EVENT_TEST_PENDING, function (test) {
16544
16516
  tests.push(test);
16545
16517
  });
16546
16518
 
16547
- runner.on(EVENT_TEST_PASS, function(test) {
16519
+ runner.on(EVENT_TEST_PASS, function (test) {
16548
16520
  tests.push(test);
16549
16521
  });
16550
16522
 
16551
- runner.on(EVENT_TEST_FAIL, function(test) {
16523
+ runner.on(EVENT_TEST_FAIL, function (test) {
16552
16524
  tests.push(test);
16553
16525
  });
16554
16526
 
16555
- runner.once(EVENT_RUN_END, function() {
16527
+ runner.once(EVENT_RUN_END, function () {
16556
16528
  self.write(
16557
16529
  tag(
16558
16530
  'testsuite',
@@ -16569,7 +16541,7 @@
16569
16541
  )
16570
16542
  );
16571
16543
 
16572
- tests.forEach(function(t) {
16544
+ tests.forEach(function (t) {
16573
16545
  self.test(t);
16574
16546
  });
16575
16547
 
@@ -16588,9 +16560,9 @@
16588
16560
  * @param failures
16589
16561
  * @param {Function} fn
16590
16562
  */
16591
- XUnit.prototype.done = function(failures, fn) {
16563
+ XUnit.prototype.done = function (failures, fn) {
16592
16564
  if (this.fileStream) {
16593
- this.fileStream.end(function() {
16565
+ this.fileStream.end(function () {
16594
16566
  fn(failures);
16595
16567
  });
16596
16568
  } else {
@@ -16603,7 +16575,7 @@
16603
16575
  *
16604
16576
  * @param {string} line
16605
16577
  */
16606
- XUnit.prototype.write = function(line) {
16578
+ XUnit.prototype.write = function (line) {
16607
16579
  if (this.fileStream) {
16608
16580
  this.fileStream.write(line + '\n');
16609
16581
  } else if (typeof process$1 === 'object' && process$1.stdout) {
@@ -16618,7 +16590,7 @@
16618
16590
  *
16619
16591
  * @param {Test} test
16620
16592
  */
16621
- XUnit.prototype.test = function(test) {
16593
+ XUnit.prototype.test = function (test) {
16622
16594
  base.useColors = false;
16623
16595
 
16624
16596
  var attrs = {
@@ -16736,7 +16708,7 @@
16736
16708
  var key = SUITE_PREFIX + suite.title;
16737
16709
 
16738
16710
  obj = obj[key] = obj[key] || {suite: suite};
16739
- suite.suites.forEach(function(suite) {
16711
+ suite.suites.forEach(function (suite) {
16740
16712
  mapTOC(suite, obj);
16741
16713
  });
16742
16714
 
@@ -16768,18 +16740,18 @@
16768
16740
 
16769
16741
  generateTOC(runner.suite);
16770
16742
 
16771
- runner.on(EVENT_SUITE_BEGIN, function(suite) {
16743
+ runner.on(EVENT_SUITE_BEGIN, function (suite) {
16772
16744
  ++level;
16773
16745
  var slug = utils.slug(suite.fullTitle());
16774
16746
  buf += '<a name="' + slug + '"></a>' + '\n';
16775
16747
  buf += title(suite.title) + '\n';
16776
16748
  });
16777
16749
 
16778
- runner.on(EVENT_SUITE_END, function() {
16750
+ runner.on(EVENT_SUITE_END, function () {
16779
16751
  --level;
16780
16752
  });
16781
16753
 
16782
- runner.on(EVENT_TEST_PASS, function(test) {
16754
+ runner.on(EVENT_TEST_PASS, function (test) {
16783
16755
  var code = utils.clean(test.body);
16784
16756
  buf += test.title + '.\n';
16785
16757
  buf += '\n```js\n';
@@ -16787,7 +16759,7 @@
16787
16759
  buf += '```\n\n';
16788
16760
  });
16789
16761
 
16790
- runner.once(EVENT_RUN_END, function() {
16762
+ runner.once(EVENT_RUN_END, function () {
16791
16763
  process$1.stdout.write('# TOC\n');
16792
16764
  process$1.stdout.write(generateTOC(runner.suite));
16793
16765
  process$1.stdout.write(buf);
@@ -16856,13 +16828,13 @@
16856
16828
  options.verbose = reporterOptions.verbose || false;
16857
16829
 
16858
16830
  // tests started
16859
- runner.on(EVENT_RUN_BEGIN, function() {
16831
+ runner.on(EVENT_RUN_BEGIN, function () {
16860
16832
  process$1.stdout.write('\n');
16861
16833
  cursor.hide();
16862
16834
  });
16863
16835
 
16864
16836
  // tests complete
16865
- runner.on(EVENT_TEST_END, function() {
16837
+ runner.on(EVENT_TEST_END, function () {
16866
16838
  complete++;
16867
16839
 
16868
16840
  var percent = complete / total;
@@ -16888,7 +16860,7 @@
16888
16860
 
16889
16861
  // tests are complete, output some stats
16890
16862
  // and the failures if any
16891
- runner.once(EVENT_RUN_END, function() {
16863
+ runner.once(EVENT_RUN_END, function () {
16892
16864
  cursor.show();
16893
16865
  process$1.stdout.write('\n');
16894
16866
  self.epilogue();
@@ -16973,12 +16945,12 @@
16973
16945
  return ' ' + color('runway', buf);
16974
16946
  }
16975
16947
 
16976
- runner.on(EVENT_RUN_BEGIN, function() {
16948
+ runner.on(EVENT_RUN_BEGIN, function () {
16977
16949
  stream.write('\n\n\n ');
16978
16950
  cursor.hide();
16979
16951
  });
16980
16952
 
16981
- runner.on(EVENT_TEST_END, function(test) {
16953
+ runner.on(EVENT_TEST_END, function (test) {
16982
16954
  // check if the plane crashed
16983
16955
  var col = crashed === -1 ? ((width * ++n) / ++total) | 0 : crashed;
16984
16956
  // show the crash
@@ -16998,16 +16970,16 @@
16998
16970
  stream.write('\u001b[0m');
16999
16971
  });
17000
16972
 
17001
- runner.once(EVENT_RUN_END, function() {
16973
+ runner.once(EVENT_RUN_END, function () {
17002
16974
  cursor.show();
17003
16975
  process$1.stdout.write('\n');
17004
16976
  self.epilogue();
17005
16977
  });
17006
16978
 
17007
16979
  // if cursor is hidden when we ctrl-C, then it will remain hidden unless...
17008
- process$1.once('SIGINT', function() {
16980
+ process$1.once('SIGINT', function () {
17009
16981
  cursor.show();
17010
- nextTick$1(function() {
16982
+ nextTick$1(function () {
17011
16983
  process$1.kill(process$1.pid, 'SIGINT');
17012
16984
  });
17013
16985
  });
@@ -17058,22 +17030,22 @@
17058
17030
  var self = this;
17059
17031
  var total = runner.total;
17060
17032
 
17061
- runner.once(EVENT_RUN_BEGIN, function() {
17033
+ runner.once(EVENT_RUN_BEGIN, function () {
17062
17034
  writeEvent(['start', {total: total}]);
17063
17035
  });
17064
17036
 
17065
- runner.on(EVENT_TEST_PASS, function(test) {
17037
+ runner.on(EVENT_TEST_PASS, function (test) {
17066
17038
  writeEvent(['pass', clean(test)]);
17067
17039
  });
17068
17040
 
17069
- runner.on(EVENT_TEST_FAIL, function(test, err) {
17041
+ runner.on(EVENT_TEST_FAIL, function (test, err) {
17070
17042
  test = clean(test);
17071
17043
  test.err = err.message;
17072
17044
  test.stack = err.stack || null;
17073
17045
  writeEvent(['fail', test]);
17074
17046
  });
17075
17047
 
17076
- runner.once(EVENT_RUN_END, function() {
17048
+ runner.once(EVENT_RUN_END, function () {
17077
17049
  writeEvent(['end', self.stats]);
17078
17050
  });
17079
17051
  }
@@ -17137,7 +17109,7 @@
17137
17109
  });
17138
17110
 
17139
17111
  var name = "mocha";
17140
- var version = "9.1.2";
17112
+ var version = "9.2.1";
17141
17113
  var homepage = "https://mochajs.org/";
17142
17114
  var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
17143
17115
  var _package = {
@@ -17181,7 +17153,7 @@
17181
17153
  * @see {@link Mocha#isGrowlCapable}
17182
17154
  * @return {boolean} whether browser notification support exists
17183
17155
  */
17184
- var isCapable = function() {
17156
+ var isCapable = function () {
17185
17157
  var hasNotificationSupport = 'Notification' in window;
17186
17158
  var hasPromiseSupport = typeof Promise === 'function';
17187
17159
  return isBrowser() && hasNotificationSupport && hasPromiseSupport;
@@ -17197,17 +17169,17 @@
17197
17169
  * @see {@link Mocha#_growl}
17198
17170
  * @param {Runner} runner - Runner instance.
17199
17171
  */
17200
- var notify = function(runner) {
17172
+ var notify = function (runner) {
17201
17173
  var promise = isPermitted();
17202
17174
 
17203
17175
  /**
17204
17176
  * Attempt notification.
17205
17177
  */
17206
- var sendNotification = function() {
17178
+ var sendNotification = function () {
17207
17179
  // If user hasn't responded yet... "No notification for you!" (Seinfeld)
17208
17180
  Promise.race([promise, Promise.resolve(undefined)])
17209
17181
  .then(canNotify)
17210
- .then(function() {
17182
+ .then(function () {
17211
17183
  display(runner);
17212
17184
  })
17213
17185
  .catch(notPermitted);
@@ -17235,7 +17207,7 @@
17235
17207
  return Promise.resolve(false);
17236
17208
  },
17237
17209
  default: function ask() {
17238
- return Notification.requestPermission().then(function(permission) {
17210
+ return Notification.requestPermission().then(function (permission) {
17239
17211
  return permission === 'granted';
17240
17212
  });
17241
17213
  }
@@ -17422,25 +17394,25 @@
17422
17394
 
17423
17395
  runner.stats = stats;
17424
17396
 
17425
- runner.once(EVENT_RUN_BEGIN, function() {
17397
+ runner.once(EVENT_RUN_BEGIN, function () {
17426
17398
  stats.start = new Date$2();
17427
17399
  });
17428
- runner.on(EVENT_SUITE_BEGIN, function(suite) {
17400
+ runner.on(EVENT_SUITE_BEGIN, function (suite) {
17429
17401
  suite.root || stats.suites++;
17430
17402
  });
17431
- runner.on(EVENT_TEST_PASS, function() {
17403
+ runner.on(EVENT_TEST_PASS, function () {
17432
17404
  stats.passes++;
17433
17405
  });
17434
- runner.on(EVENT_TEST_FAIL, function() {
17406
+ runner.on(EVENT_TEST_FAIL, function () {
17435
17407
  stats.failures++;
17436
17408
  });
17437
- runner.on(EVENT_TEST_PENDING, function() {
17409
+ runner.on(EVENT_TEST_PENDING, function () {
17438
17410
  stats.pending++;
17439
17411
  });
17440
- runner.on(EVENT_TEST_END, function() {
17412
+ runner.on(EVENT_TEST_END, function () {
17441
17413
  stats.tests++;
17442
17414
  });
17443
- runner.once(EVENT_RUN_END, function() {
17415
+ runner.once(EVENT_RUN_END, function () {
17444
17416
  stats.end = new Date$2();
17445
17417
  stats.duration = stats.end - stats.start;
17446
17418
  });
@@ -17487,7 +17459,7 @@
17487
17459
  /**
17488
17460
  * Resets the state initially or for a next run.
17489
17461
  */
17490
- Test.prototype.reset = function() {
17462
+ Test.prototype.reset = function () {
17491
17463
  runnable.prototype.reset.call(this);
17492
17464
  this.pending = !this.fn;
17493
17465
  delete this.state;
@@ -17498,7 +17470,7 @@
17498
17470
  *
17499
17471
  * @private
17500
17472
  */
17501
- Test.prototype.retriedTest = function(n) {
17473
+ Test.prototype.retriedTest = function (n) {
17502
17474
  if (!arguments.length) {
17503
17475
  return this._retriedTest;
17504
17476
  }
@@ -17510,11 +17482,11 @@
17510
17482
  *
17511
17483
  * @private
17512
17484
  */
17513
- Test.prototype.markOnly = function() {
17485
+ Test.prototype.markOnly = function () {
17514
17486
  this.parent.appendOnlyTest(this);
17515
17487
  };
17516
17488
 
17517
- Test.prototype.clone = function() {
17489
+ Test.prototype.clone = function () {
17518
17490
  var test = new Test(this.title, this.fn);
17519
17491
  test.timeout(this.timeout());
17520
17492
  test.slow(this.slow());
@@ -17577,7 +17549,7 @@
17577
17549
  * @param {Mocha} mocha
17578
17550
  * @return {Object} An object containing common functions.
17579
17551
  */
17580
- var common = function(suites, context, mocha) {
17552
+ var common = function (suites, context, mocha) {
17581
17553
  /**
17582
17554
  * Check if the suite should be tested.
17583
17555
  *
@@ -17614,7 +17586,7 @@
17614
17586
  * @param {string} name
17615
17587
  * @param {Function} fn
17616
17588
  */
17617
- before: function(name, fn) {
17589
+ before: function (name, fn) {
17618
17590
  suites[0].beforeAll(name, fn);
17619
17591
  },
17620
17592
 
@@ -17624,7 +17596,7 @@
17624
17596
  * @param {string} name
17625
17597
  * @param {Function} fn
17626
17598
  */
17627
- after: function(name, fn) {
17599
+ after: function (name, fn) {
17628
17600
  suites[0].afterAll(name, fn);
17629
17601
  },
17630
17602
 
@@ -17634,7 +17606,7 @@
17634
17606
  * @param {string} name
17635
17607
  * @param {Function} fn
17636
17608
  */
17637
- beforeEach: function(name, fn) {
17609
+ beforeEach: function (name, fn) {
17638
17610
  suites[0].beforeEach(name, fn);
17639
17611
  },
17640
17612
 
@@ -17644,7 +17616,7 @@
17644
17616
  * @param {string} name
17645
17617
  * @param {Function} fn
17646
17618
  */
17647
- afterEach: function(name, fn) {
17619
+ afterEach: function (name, fn) {
17648
17620
  suites[0].afterEach(name, fn);
17649
17621
  },
17650
17622
 
@@ -17730,7 +17702,7 @@
17730
17702
  * @param {Function} test
17731
17703
  * @returns {*}
17732
17704
  */
17733
- only: function(mocha, test) {
17705
+ only: function (mocha, test) {
17734
17706
  if (mocha.options.forbidOnly) {
17735
17707
  throw createForbiddenExclusivityError(mocha);
17736
17708
  }
@@ -17743,15 +17715,15 @@
17743
17715
  *
17744
17716
  * @param {string} title
17745
17717
  */
17746
- skip: function(title) {
17718
+ skip: function (title) {
17747
17719
  context.test(title);
17748
17720
  }
17749
17721
  }
17750
17722
  };
17751
17723
  };
17752
17724
 
17753
- var EVENT_FILE_PRE_REQUIRE$2 = suite.constants
17754
- .EVENT_FILE_PRE_REQUIRE;
17725
+ var EVENT_FILE_PRE_REQUIRE$2 =
17726
+ suite.constants.EVENT_FILE_PRE_REQUIRE;
17755
17727
 
17756
17728
  /**
17757
17729
  * BDD-style interface:
@@ -17773,7 +17745,7 @@
17773
17745
  var bdd$1 = function bddInterface(suite) {
17774
17746
  var suites = [suite];
17775
17747
 
17776
- suite.on(EVENT_FILE_PRE_REQUIRE$2, function(context, file, mocha) {
17748
+ suite.on(EVENT_FILE_PRE_REQUIRE$2, function (context, file, mocha) {
17777
17749
  var common$1 = common(suites, context, mocha);
17778
17750
 
17779
17751
  context.before = common$1.before;
@@ -17787,7 +17759,7 @@
17787
17759
  * and/or tests.
17788
17760
  */
17789
17761
 
17790
- context.describe = context.context = function(title, fn) {
17762
+ context.describe = context.context = function (title, fn) {
17791
17763
  return common$1.suite.create({
17792
17764
  title: title,
17793
17765
  file: file,
@@ -17799,22 +17771,22 @@
17799
17771
  * Pending describe.
17800
17772
  */
17801
17773
 
17802
- context.xdescribe = context.xcontext = context.describe.skip = function(
17803
- title,
17804
- fn
17805
- ) {
17806
- return common$1.suite.skip({
17807
- title: title,
17808
- file: file,
17809
- fn: fn
17810
- });
17811
- };
17774
+ context.xdescribe =
17775
+ context.xcontext =
17776
+ context.describe.skip =
17777
+ function (title, fn) {
17778
+ return common$1.suite.skip({
17779
+ title: title,
17780
+ file: file,
17781
+ fn: fn
17782
+ });
17783
+ };
17812
17784
 
17813
17785
  /**
17814
17786
  * Exclusive suite.
17815
17787
  */
17816
17788
 
17817
- context.describe.only = function(title, fn) {
17789
+ context.describe.only = function (title, fn) {
17818
17790
  return common$1.suite.only({
17819
17791
  title: title,
17820
17792
  file: file,
@@ -17828,7 +17800,7 @@
17828
17800
  * acting as a thunk.
17829
17801
  */
17830
17802
 
17831
- context.it = context.specify = function(title, fn) {
17803
+ context.it = context.specify = function (title, fn) {
17832
17804
  var suite = suites[0];
17833
17805
  if (suite.isPending()) {
17834
17806
  fn = null;
@@ -17843,7 +17815,7 @@
17843
17815
  * Exclusive test-case.
17844
17816
  */
17845
17817
 
17846
- context.it.only = function(title, fn) {
17818
+ context.it.only = function (title, fn) {
17847
17819
  return common$1.test.only(mocha, context.it(title, fn));
17848
17820
  };
17849
17821
 
@@ -17851,17 +17823,20 @@
17851
17823
  * Pending test case.
17852
17824
  */
17853
17825
 
17854
- context.xit = context.xspecify = context.it.skip = function(title) {
17855
- return context.it(title);
17856
- };
17826
+ context.xit =
17827
+ context.xspecify =
17828
+ context.it.skip =
17829
+ function (title) {
17830
+ return context.it(title);
17831
+ };
17857
17832
  });
17858
17833
  };
17859
17834
 
17860
17835
  var description$3 = 'BDD or RSpec style [default]';
17861
17836
  bdd$1.description = description$3;
17862
17837
 
17863
- var EVENT_FILE_PRE_REQUIRE$1 = suite.constants
17864
- .EVENT_FILE_PRE_REQUIRE;
17838
+ var EVENT_FILE_PRE_REQUIRE$1 =
17839
+ suite.constants.EVENT_FILE_PRE_REQUIRE;
17865
17840
 
17866
17841
  /**
17867
17842
  * TDD-style interface:
@@ -17888,10 +17863,10 @@
17888
17863
  *
17889
17864
  * @param {Suite} suite Root suite.
17890
17865
  */
17891
- var tdd$1 = function(suite) {
17866
+ var tdd$1 = function (suite) {
17892
17867
  var suites = [suite];
17893
17868
 
17894
- suite.on(EVENT_FILE_PRE_REQUIRE$1, function(context, file, mocha) {
17869
+ suite.on(EVENT_FILE_PRE_REQUIRE$1, function (context, file, mocha) {
17895
17870
  var common$1 = common(suites, context, mocha);
17896
17871
 
17897
17872
  context.setup = common$1.beforeEach;
@@ -17904,7 +17879,7 @@
17904
17879
  * Describe a "suite" with the given `title` and callback `fn` containing
17905
17880
  * nested suites and/or tests.
17906
17881
  */
17907
- context.suite = function(title, fn) {
17882
+ context.suite = function (title, fn) {
17908
17883
  return common$1.suite.create({
17909
17884
  title: title,
17910
17885
  file: file,
@@ -17915,7 +17890,7 @@
17915
17890
  /**
17916
17891
  * Pending suite.
17917
17892
  */
17918
- context.suite.skip = function(title, fn) {
17893
+ context.suite.skip = function (title, fn) {
17919
17894
  return common$1.suite.skip({
17920
17895
  title: title,
17921
17896
  file: file,
@@ -17926,7 +17901,7 @@
17926
17901
  /**
17927
17902
  * Exclusive test-case.
17928
17903
  */
17929
- context.suite.only = function(title, fn) {
17904
+ context.suite.only = function (title, fn) {
17930
17905
  return common$1.suite.only({
17931
17906
  title: title,
17932
17907
  file: file,
@@ -17938,7 +17913,7 @@
17938
17913
  * Describe a specification or test-case with the given `title` and
17939
17914
  * callback `fn` acting as a thunk.
17940
17915
  */
17941
- context.test = function(title, fn) {
17916
+ context.test = function (title, fn) {
17942
17917
  var suite = suites[0];
17943
17918
  if (suite.isPending()) {
17944
17919
  fn = null;
@@ -17953,7 +17928,7 @@
17953
17928
  * Exclusive test-case.
17954
17929
  */
17955
17930
 
17956
- context.test.only = function(title, fn) {
17931
+ context.test.only = function (title, fn) {
17957
17932
  return common$1.test.only(mocha, context.test(title, fn));
17958
17933
  };
17959
17934
 
@@ -17965,8 +17940,8 @@
17965
17940
  'traditional "suite"/"test" instead of BDD\'s "describe"/"it"';
17966
17941
  tdd$1.description = description$2;
17967
17942
 
17968
- var EVENT_FILE_PRE_REQUIRE = suite.constants
17969
- .EVENT_FILE_PRE_REQUIRE;
17943
+ var EVENT_FILE_PRE_REQUIRE =
17944
+ suite.constants.EVENT_FILE_PRE_REQUIRE;
17970
17945
 
17971
17946
  /**
17972
17947
  * QUnit-style interface:
@@ -17996,7 +17971,7 @@
17996
17971
  var qunit$1 = function qUnitInterface(suite) {
17997
17972
  var suites = [suite];
17998
17973
 
17999
- suite.on(EVENT_FILE_PRE_REQUIRE, function(context, file, mocha) {
17974
+ suite.on(EVENT_FILE_PRE_REQUIRE, function (context, file, mocha) {
18000
17975
  var common$1 = common(suites, context, mocha);
18001
17976
 
18002
17977
  context.before = common$1.before;
@@ -18008,7 +17983,7 @@
18008
17983
  * Describe a "suite" with the given `title`.
18009
17984
  */
18010
17985
 
18011
- context.suite = function(title) {
17986
+ context.suite = function (title) {
18012
17987
  if (suites.length > 1) {
18013
17988
  suites.shift();
18014
17989
  }
@@ -18023,7 +17998,7 @@
18023
17998
  * Exclusive Suite.
18024
17999
  */
18025
18000
 
18026
- context.suite.only = function(title) {
18001
+ context.suite.only = function (title) {
18027
18002
  if (suites.length > 1) {
18028
18003
  suites.shift();
18029
18004
  }
@@ -18040,7 +18015,7 @@
18040
18015
  * acting as a thunk.
18041
18016
  */
18042
18017
 
18043
- context.test = function(title, fn) {
18018
+ context.test = function (title, fn) {
18044
18019
  var test$1 = new test(title, fn);
18045
18020
  test$1.file = file;
18046
18021
  suites[0].addTest(test$1);
@@ -18051,7 +18026,7 @@
18051
18026
  * Exclusive test-case.
18052
18027
  */
18053
18028
 
18054
- context.test.only = function(title, fn) {
18029
+ context.test.only = function (title, fn) {
18055
18030
  return common$1.test.only(mocha, context.test(title, fn));
18056
18031
  };
18057
18032
 
@@ -18079,7 +18054,7 @@
18079
18054
  *
18080
18055
  * @param {Suite} suite Root suite.
18081
18056
  */
18082
- var exports$2 = function(suite$1) {
18057
+ var exports$2 = function (suite$1) {
18083
18058
  var suites = [suite$1];
18084
18059
 
18085
18060
  suite$1.on(suite.constants.EVENT_FILE_REQUIRE, visit);
@@ -18155,7 +18130,7 @@
18155
18130
  * @param {Runnable} runnable
18156
18131
  * @return {Context} context
18157
18132
  */
18158
- Context.prototype.runnable = function(runnable) {
18133
+ Context.prototype.runnable = function (runnable) {
18159
18134
  if (!arguments.length) {
18160
18135
  return this._runnable;
18161
18136
  }
@@ -18170,7 +18145,7 @@
18170
18145
  * @param {number} ms
18171
18146
  * @return {Context} self
18172
18147
  */
18173
- Context.prototype.timeout = function(ms) {
18148
+ Context.prototype.timeout = function (ms) {
18174
18149
  if (!arguments.length) {
18175
18150
  return this.runnable().timeout();
18176
18151
  }
@@ -18185,7 +18160,7 @@
18185
18160
  * @param {number} ms
18186
18161
  * @return {Context} self
18187
18162
  */
18188
- Context.prototype.slow = function(ms) {
18163
+ Context.prototype.slow = function (ms) {
18189
18164
  if (!arguments.length) {
18190
18165
  return this.runnable().slow();
18191
18166
  }
@@ -18199,7 +18174,7 @@
18199
18174
  * @private
18200
18175
  * @throws Pending
18201
18176
  */
18202
- Context.prototype.skip = function() {
18177
+ Context.prototype.skip = function () {
18203
18178
  this.runnable().skip();
18204
18179
  };
18205
18180
 
@@ -18210,7 +18185,7 @@
18210
18185
  * @param {number} n
18211
18186
  * @return {Context} self
18212
18187
  */
18213
- Context.prototype.retries = function(n) {
18188
+ Context.prototype.retries = function (n) {
18214
18189
  if (!arguments.length) {
18215
18190
  return this.runnable().retries();
18216
18191
  }
@@ -18245,11 +18220,8 @@
18245
18220
  createMochaInstanceAlreadyRunningError,
18246
18221
  createUnsupportedError
18247
18222
  } = errors;
18248
- const {
18249
- EVENT_FILE_PRE_REQUIRE,
18250
- EVENT_FILE_POST_REQUIRE,
18251
- EVENT_FILE_REQUIRE
18252
- } = suite.constants;
18223
+ const {EVENT_FILE_PRE_REQUIRE, EVENT_FILE_POST_REQUIRE, EVENT_FILE_REQUIRE} =
18224
+ suite.constants;
18253
18225
  var debug = browser('mocha:mocha');
18254
18226
 
18255
18227
  exports = module.exports = Mocha;
@@ -18316,46 +18288,46 @@
18316
18288
  exports.Test = test;
18317
18289
 
18318
18290
  let currentContext;
18319
- exports.afterEach = function(...args) {
18291
+ exports.afterEach = function (...args) {
18320
18292
  return (currentContext.afterEach || currentContext.teardown).apply(
18321
18293
  this,
18322
18294
  args
18323
18295
  );
18324
18296
  };
18325
- exports.after = function(...args) {
18297
+ exports.after = function (...args) {
18326
18298
  return (currentContext.after || currentContext.suiteTeardown).apply(
18327
18299
  this,
18328
18300
  args
18329
18301
  );
18330
18302
  };
18331
- exports.beforeEach = function(...args) {
18303
+ exports.beforeEach = function (...args) {
18332
18304
  return (currentContext.beforeEach || currentContext.setup).apply(this, args);
18333
18305
  };
18334
- exports.before = function(...args) {
18306
+ exports.before = function (...args) {
18335
18307
  return (currentContext.before || currentContext.suiteSetup).apply(this, args);
18336
18308
  };
18337
- exports.describe = function(...args) {
18309
+ exports.describe = function (...args) {
18338
18310
  return (currentContext.describe || currentContext.suite).apply(this, args);
18339
18311
  };
18340
- exports.describe.only = function(...args) {
18312
+ exports.describe.only = function (...args) {
18341
18313
  return (currentContext.describe || currentContext.suite).only.apply(
18342
18314
  this,
18343
18315
  args
18344
18316
  );
18345
18317
  };
18346
- exports.describe.skip = function(...args) {
18318
+ exports.describe.skip = function (...args) {
18347
18319
  return (currentContext.describe || currentContext.suite).skip.apply(
18348
18320
  this,
18349
18321
  args
18350
18322
  );
18351
18323
  };
18352
- exports.it = function(...args) {
18324
+ exports.it = function (...args) {
18353
18325
  return (currentContext.it || currentContext.test).apply(this, args);
18354
18326
  };
18355
- exports.it.only = function(...args) {
18327
+ exports.it.only = function (...args) {
18356
18328
  return (currentContext.it || currentContext.test).only.apply(this, args);
18357
18329
  };
18358
- exports.it.skip = function(...args) {
18330
+ exports.it.skip = function (...args) {
18359
18331
  return (currentContext.it || currentContext.test).skip.apply(this, args);
18360
18332
  };
18361
18333
  exports.xdescribe = exports.describe.skip;
@@ -18366,7 +18338,7 @@
18366
18338
  exports.suite = exports.describe;
18367
18339
  exports.teardown = exports.afterEach;
18368
18340
  exports.test = exports.it;
18369
- exports.run = function(...args) {
18341
+ exports.run = function (...args) {
18370
18342
  return currentContext.run.apply(this, args);
18371
18343
  };
18372
18344
 
@@ -18451,7 +18423,7 @@
18451
18423
  'growl',
18452
18424
  'inlineDiffs',
18453
18425
  'invert'
18454
- ].forEach(function(opt) {
18426
+ ].forEach(function (opt) {
18455
18427
  if (options[opt]) {
18456
18428
  this[opt]();
18457
18429
  }
@@ -18509,7 +18481,7 @@
18509
18481
  * @returns {Mocha} this
18510
18482
  * @chainable
18511
18483
  */
18512
- Mocha.prototype.bail = function(bail) {
18484
+ Mocha.prototype.bail = function (bail) {
18513
18485
  this.suite.bail(bail !== false);
18514
18486
  return this;
18515
18487
  };
@@ -18527,7 +18499,7 @@
18527
18499
  * @returns {Mocha} this
18528
18500
  * @chainable
18529
18501
  */
18530
- Mocha.prototype.addFile = function(file) {
18502
+ Mocha.prototype.addFile = function (file) {
18531
18503
  this.files.push(file);
18532
18504
  return this;
18533
18505
  };
@@ -18548,7 +18520,7 @@
18548
18520
  * // Use XUnit reporter and direct its output to file
18549
18521
  * mocha.reporter('xunit', { output: '/path/to/testspec.xunit.xml' });
18550
18522
  */
18551
- Mocha.prototype.reporter = function(reporterName, reporterOptions) {
18523
+ Mocha.prototype.reporter = function (reporterName, reporterOptions) {
18552
18524
  if (typeof reporterName === 'function') {
18553
18525
  this._reporter = reporterName;
18554
18526
  } else {
@@ -18604,7 +18576,7 @@
18604
18576
  * @chainable
18605
18577
  * @throws {Error} if requested interface cannot be loaded
18606
18578
  */
18607
- Mocha.prototype.ui = function(ui) {
18579
+ Mocha.prototype.ui = function (ui) {
18608
18580
  var bindInterface;
18609
18581
  if (typeof ui === 'function') {
18610
18582
  bindInterface = ui;
@@ -18621,7 +18593,7 @@
18621
18593
  }
18622
18594
  bindInterface(this.suite);
18623
18595
 
18624
- this.suite.on(EVENT_FILE_PRE_REQUIRE, function(context) {
18596
+ this.suite.on(EVENT_FILE_PRE_REQUIRE, function (context) {
18625
18597
  currentContext = context;
18626
18598
  });
18627
18599
 
@@ -18643,10 +18615,10 @@
18643
18615
  * @see {@link Mocha#loadFilesAsync}
18644
18616
  * @param {Function} [fn] - Callback invoked upon completion.
18645
18617
  */
18646
- Mocha.prototype.loadFiles = function(fn) {
18618
+ Mocha.prototype.loadFiles = function (fn) {
18647
18619
  var self = this;
18648
18620
  var suite = this.suite;
18649
- this.files.forEach(function(file) {
18621
+ this.files.forEach(function (file) {
18650
18622
  file = path.resolve(file);
18651
18623
  suite.emit(EVENT_FILE_PRE_REQUIRE, commonjsGlobal, file, self);
18652
18624
  suite.emit(EVENT_FILE_REQUIRE, commonjsRequire(), file, self);
@@ -18675,17 +18647,17 @@
18675
18647
  * .then(() => mocha.run(failures => process.exitCode = failures ? 1 : 0))
18676
18648
  * .catch(() => process.exitCode = 1);
18677
18649
  */
18678
- Mocha.prototype.loadFilesAsync = function() {
18650
+ Mocha.prototype.loadFilesAsync = function () {
18679
18651
  var self = this;
18680
18652
  var suite = this.suite;
18681
18653
  this.lazyLoadFiles(true);
18682
18654
 
18683
18655
  return require$$10.loadFilesAsync(
18684
18656
  this.files,
18685
- function(file) {
18657
+ function (file) {
18686
18658
  suite.emit(EVENT_FILE_PRE_REQUIRE, commonjsGlobal, file, self);
18687
18659
  },
18688
- function(file, resultModule) {
18660
+ function (file, resultModule) {
18689
18661
  suite.emit(EVENT_FILE_REQUIRE, resultModule, file, self);
18690
18662
  suite.emit(EVENT_FILE_POST_REQUIRE, commonjsGlobal, file, self);
18691
18663
  }
@@ -18700,7 +18672,7 @@
18700
18672
  * @see {@link Mocha#unloadFiles}
18701
18673
  * @param {string} file - Pathname of file to be unloaded.
18702
18674
  */
18703
- Mocha.unloadFile = function(file) {
18675
+ Mocha.unloadFile = function (file) {
18704
18676
  if (utils.isBrowser()) {
18705
18677
  throw createUnsupportedError(
18706
18678
  'unloadFile() is only suported in a Node.js environment'
@@ -18724,7 +18696,7 @@
18724
18696
  * @returns {Mocha} this
18725
18697
  * @chainable
18726
18698
  */
18727
- Mocha.prototype.unloadFiles = function() {
18699
+ Mocha.prototype.unloadFiles = function () {
18728
18700
  if (this._state === mochaStates.DISPOSED) {
18729
18701
  throw createMochaInstanceAlreadyDisposedError(
18730
18702
  'Mocha instance is already disposed, it cannot be used again.',
@@ -18733,7 +18705,7 @@
18733
18705
  );
18734
18706
  }
18735
18707
 
18736
- this.files.forEach(function(file) {
18708
+ this.files.forEach(function (file) {
18737
18709
  Mocha.unloadFile(file);
18738
18710
  });
18739
18711
  this._state = mochaStates.INIT;
@@ -18753,7 +18725,7 @@
18753
18725
  * // Select tests whose full title begins with `"foo"` followed by a period
18754
18726
  * mocha.fgrep('foo.');
18755
18727
  */
18756
- Mocha.prototype.fgrep = function(str) {
18728
+ Mocha.prototype.fgrep = function (str) {
18757
18729
  if (!str) {
18758
18730
  return this;
18759
18731
  }
@@ -18794,7 +18766,7 @@
18794
18766
  * // Given embedded test `it('only-this-test')`...
18795
18767
  * mocha.grep('/^only-this-test$/'); // NO! Use `.only()` to do this!
18796
18768
  */
18797
- Mocha.prototype.grep = function(re) {
18769
+ Mocha.prototype.grep = function (re) {
18798
18770
  if (utils.isString(re)) {
18799
18771
  // extract args if it's regex-like, i.e: [string, pattern, flag]
18800
18772
  var arg = re.match(/^\/(.*)\/([gimy]{0,4})$|.*/);
@@ -18817,7 +18789,7 @@
18817
18789
  * // Select tests whose full title does *not* contain `"match"`, ignoring case
18818
18790
  * mocha.grep(/match/i).invert();
18819
18791
  */
18820
- Mocha.prototype.invert = function() {
18792
+ Mocha.prototype.invert = function () {
18821
18793
  this.options.invert = true;
18822
18794
  return this;
18823
18795
  };
@@ -18831,7 +18803,7 @@
18831
18803
  * @return {Mocha} this
18832
18804
  * @chainable
18833
18805
  */
18834
- Mocha.prototype.checkLeaks = function(checkLeaks) {
18806
+ Mocha.prototype.checkLeaks = function (checkLeaks) {
18835
18807
  this.options.checkLeaks = checkLeaks !== false;
18836
18808
  return this;
18837
18809
  };
@@ -18846,7 +18818,7 @@
18846
18818
  * @return {Mocha} this
18847
18819
  * @chainable
18848
18820
  */
18849
- Mocha.prototype.cleanReferencesAfterRun = function(cleanReferencesAfterRun) {
18821
+ Mocha.prototype.cleanReferencesAfterRun = function (cleanReferencesAfterRun) {
18850
18822
  this._cleanReferencesAfterRun = cleanReferencesAfterRun !== false;
18851
18823
  return this;
18852
18824
  };
@@ -18856,7 +18828,7 @@
18856
18828
  * It also removes function references to tests functions and hooks, so variables trapped in closures can be cleaned by the garbage collector.
18857
18829
  * @public
18858
18830
  */
18859
- Mocha.prototype.dispose = function() {
18831
+ Mocha.prototype.dispose = function () {
18860
18832
  if (this._state === mochaStates.RUNNING) {
18861
18833
  throw createMochaInstanceAlreadyRunningError(
18862
18834
  'Cannot dispose while the mocha instance is still running tests.'
@@ -18877,7 +18849,7 @@
18877
18849
  * @return {Mocha} this
18878
18850
  * @chainable
18879
18851
  */
18880
- Mocha.prototype.fullTrace = function(fullTrace) {
18852
+ Mocha.prototype.fullTrace = function (fullTrace) {
18881
18853
  this.options.fullTrace = fullTrace !== false;
18882
18854
  return this;
18883
18855
  };
@@ -18890,7 +18862,7 @@
18890
18862
  * @return {Mocha} this
18891
18863
  * @chainable
18892
18864
  */
18893
- Mocha.prototype.growl = function() {
18865
+ Mocha.prototype.growl = function () {
18894
18866
  this.options.growl = this.isGrowlCapable();
18895
18867
  if (!this.options.growl) {
18896
18868
  var detail = utils.isBrowser()
@@ -18939,11 +18911,11 @@
18939
18911
  * // Specify variables to be expected in global scope
18940
18912
  * mocha.global(['jQuery', 'MyLib']);
18941
18913
  */
18942
- Mocha.prototype.global = function(global) {
18914
+ Mocha.prototype.global = function (global) {
18943
18915
  this.options.global = (this.options.global || [])
18944
18916
  .concat(global)
18945
18917
  .filter(Boolean)
18946
- .filter(function(elt, idx, arr) {
18918
+ .filter(function (elt, idx, arr) {
18947
18919
  return arr.indexOf(elt) === idx;
18948
18920
  });
18949
18921
  return this;
@@ -18960,7 +18932,7 @@
18960
18932
  * @return {Mocha} this
18961
18933
  * @chainable
18962
18934
  */
18963
- Mocha.prototype.color = function(color) {
18935
+ Mocha.prototype.color = function (color) {
18964
18936
  this.options.color = color !== false;
18965
18937
  return this;
18966
18938
  };
@@ -18975,7 +18947,7 @@
18975
18947
  * @return {Mocha} this
18976
18948
  * @chainable
18977
18949
  */
18978
- Mocha.prototype.inlineDiffs = function(inlineDiffs) {
18950
+ Mocha.prototype.inlineDiffs = function (inlineDiffs) {
18979
18951
  this.options.inlineDiffs = inlineDiffs !== false;
18980
18952
  return this;
18981
18953
  };
@@ -18989,7 +18961,7 @@
18989
18961
  * @return {Mocha} this
18990
18962
  * @chainable
18991
18963
  */
18992
- Mocha.prototype.diff = function(diff) {
18964
+ Mocha.prototype.diff = function (diff) {
18993
18965
  this.options.diff = diff !== false;
18994
18966
  return this;
18995
18967
  };
@@ -19017,7 +18989,7 @@
19017
18989
  * // Same as above but using string argument
19018
18990
  * mocha.timeout('1s');
19019
18991
  */
19020
- Mocha.prototype.timeout = function(msecs) {
18992
+ Mocha.prototype.timeout = function (msecs) {
19021
18993
  this.suite.timeout(msecs);
19022
18994
  return this;
19023
18995
  };
@@ -19036,7 +19008,7 @@
19036
19008
  * // Allow any failed test to retry one more time
19037
19009
  * mocha.retries(1);
19038
19010
  */
19039
- Mocha.prototype.retries = function(retry) {
19011
+ Mocha.prototype.retries = function (retry) {
19040
19012
  this.suite.retries(retry);
19041
19013
  return this;
19042
19014
  };
@@ -19058,7 +19030,7 @@
19058
19030
  * // Same as above but using string argument
19059
19031
  * mocha.slow('0.5s');
19060
19032
  */
19061
- Mocha.prototype.slow = function(msecs) {
19033
+ Mocha.prototype.slow = function (msecs) {
19062
19034
  this.suite.slow(msecs);
19063
19035
  return this;
19064
19036
  };
@@ -19072,7 +19044,7 @@
19072
19044
  * @return {Mocha} this
19073
19045
  * @chainable
19074
19046
  */
19075
- Mocha.prototype.asyncOnly = function(asyncOnly) {
19047
+ Mocha.prototype.asyncOnly = function (asyncOnly) {
19076
19048
  this.options.asyncOnly = asyncOnly !== false;
19077
19049
  return this;
19078
19050
  };
@@ -19084,7 +19056,7 @@
19084
19056
  * @return {Mocha} this
19085
19057
  * @chainable
19086
19058
  */
19087
- Mocha.prototype.noHighlighting = function() {
19059
+ Mocha.prototype.noHighlighting = function () {
19088
19060
  this.options.noHighlighting = true;
19089
19061
  return this;
19090
19062
  };
@@ -19098,7 +19070,7 @@
19098
19070
  * @return {Mocha} this
19099
19071
  * @chainable
19100
19072
  */
19101
- Mocha.prototype.allowUncaught = function(allowUncaught) {
19073
+ Mocha.prototype.allowUncaught = function (allowUncaught) {
19102
19074
  this.options.allowUncaught = allowUncaught !== false;
19103
19075
  return this;
19104
19076
  };
@@ -19129,7 +19101,7 @@
19129
19101
  * @return {Mocha} this
19130
19102
  * @chainable
19131
19103
  */
19132
- Mocha.prototype.dryRun = function(dryRun) {
19104
+ Mocha.prototype.dryRun = function (dryRun) {
19133
19105
  this.options.dryRun = dryRun !== false;
19134
19106
  return this;
19135
19107
  };
@@ -19143,7 +19115,7 @@
19143
19115
  * @return {Mocha} this
19144
19116
  * @chainable
19145
19117
  */
19146
- Mocha.prototype.failZero = function(failZero) {
19118
+ Mocha.prototype.failZero = function (failZero) {
19147
19119
  this.options.failZero = failZero !== false;
19148
19120
  return this;
19149
19121
  };
@@ -19157,7 +19129,7 @@
19157
19129
  * @returns {Mocha} this
19158
19130
  * @chainable
19159
19131
  */
19160
- Mocha.prototype.forbidOnly = function(forbidOnly) {
19132
+ Mocha.prototype.forbidOnly = function (forbidOnly) {
19161
19133
  this.options.forbidOnly = forbidOnly !== false;
19162
19134
  return this;
19163
19135
  };
@@ -19171,7 +19143,7 @@
19171
19143
  * @returns {Mocha} this
19172
19144
  * @chainable
19173
19145
  */
19174
- Mocha.prototype.forbidPending = function(forbidPending) {
19146
+ Mocha.prototype.forbidPending = function (forbidPending) {
19175
19147
  this.options.forbidPending = forbidPending !== false;
19176
19148
  return this;
19177
19149
  };
@@ -19180,7 +19152,7 @@
19180
19152
  * Throws an error if mocha is in the wrong state to be able to transition to a "running" state.
19181
19153
  * @private
19182
19154
  */
19183
- Mocha.prototype._guardRunningStateTransition = function() {
19155
+ Mocha.prototype._guardRunningStateTransition = function () {
19184
19156
  if (this._state === mochaStates.RUNNING) {
19185
19157
  throw createMochaInstanceAlreadyRunningError(
19186
19158
  'Mocha instance is currently running tests, cannot start a next test run until this one is done',
@@ -19239,7 +19211,7 @@
19239
19211
  * // exit with non-zero status if there were test failures
19240
19212
  * mocha.run(failures => process.exitCode = failures ? 1 : 0);
19241
19213
  */
19242
- Mocha.prototype.run = function(fn) {
19214
+ Mocha.prototype.run = function (fn) {
19243
19215
  this._guardRunningStateTransition();
19244
19216
  this._state = mochaStates.RUNNING;
19245
19217
  if (this._previousRunner) {
@@ -19542,9 +19514,10 @@
19542
19514
  * @public
19543
19515
  * @returns {boolean}
19544
19516
  */
19545
- Mocha.prototype.hasGlobalTeardownFixtures = function hasGlobalTeardownFixtures() {
19546
- return Boolean(this.options.globalTeardown.length);
19547
- };
19517
+ Mocha.prototype.hasGlobalTeardownFixtures =
19518
+ function hasGlobalTeardownFixtures() {
19519
+ return Boolean(this.options.globalTeardown.length);
19520
+ };
19548
19521
 
19549
19522
  /**
19550
19523
  * An alternative way to define root hooks that works with parallel runs.
@@ -19636,12 +19609,12 @@
19636
19609
  * Revert to original onerror handler if previously defined.
19637
19610
  */
19638
19611
 
19639
- process$1.removeListener = function(e, fn) {
19612
+ process$1.removeListener = function (e, fn) {
19640
19613
  if (e === 'uncaughtException') {
19641
19614
  if (originalOnerrorHandler) {
19642
19615
  commonjsGlobal.onerror = originalOnerrorHandler;
19643
19616
  } else {
19644
- commonjsGlobal.onerror = function() {};
19617
+ commonjsGlobal.onerror = function () {};
19645
19618
  }
19646
19619
  var i = uncaughtExceptionHandlers.indexOf(fn);
19647
19620
  if (i !== -1) {
@@ -19654,7 +19627,7 @@
19654
19627
  * Implements listenerCount for 'uncaughtException'.
19655
19628
  */
19656
19629
 
19657
- process$1.listenerCount = function(name) {
19630
+ process$1.listenerCount = function (name) {
19658
19631
  if (name === 'uncaughtException') {
19659
19632
  return uncaughtExceptionHandlers.length;
19660
19633
  }
@@ -19665,9 +19638,9 @@
19665
19638
  * Implements uncaughtException listener.
19666
19639
  */
19667
19640
 
19668
- process$1.on = function(e, fn) {
19641
+ process$1.on = function (e, fn) {
19669
19642
  if (e === 'uncaughtException') {
19670
- commonjsGlobal.onerror = function(err, url, line) {
19643
+ commonjsGlobal.onerror = function (err, url, line) {
19671
19644
  fn(new Error(err + ' (' + url + ':' + line + ')'));
19672
19645
  return !mocha.options.allowUncaught;
19673
19646
  };
@@ -19675,7 +19648,7 @@
19675
19648
  }
19676
19649
  };
19677
19650
 
19678
- process$1.listeners = function(e) {
19651
+ process$1.listeners = function (e) {
19679
19652
  if (e === 'uncaughtException') {
19680
19653
  return uncaughtExceptionHandlers;
19681
19654
  }
@@ -19706,7 +19679,7 @@
19706
19679
  * High-performance override of Runner.immediately.
19707
19680
  */
19708
19681
 
19709
- mocha$1.Runner.immediately = function(callback) {
19682
+ mocha$1.Runner.immediately = function (callback) {
19710
19683
  immediateQueue.push(callback);
19711
19684
  if (!immediateTimeout) {
19712
19685
  immediateTimeout = setTimeout$1(timeslice, 0);
@@ -19718,8 +19691,8 @@
19718
19691
  * This is useful when running tests in a browser because window.onerror will
19719
19692
  * only receive the 'message' attribute of the Error.
19720
19693
  */
19721
- mocha.throwError = function(err) {
19722
- uncaughtExceptionHandlers.forEach(function(fn) {
19694
+ mocha.throwError = function (err) {
19695
+ uncaughtExceptionHandlers.forEach(function (fn) {
19723
19696
  fn(err);
19724
19697
  });
19725
19698
  throw err;
@@ -19730,7 +19703,7 @@
19730
19703
  * Normally this would happen in Mocha.prototype.loadFiles.
19731
19704
  */
19732
19705
 
19733
- mocha.ui = function(ui) {
19706
+ mocha.ui = function (ui) {
19734
19707
  mocha$1.prototype.ui.call(this, ui);
19735
19708
  this.suite.emit('pre-require', commonjsGlobal, null, this);
19736
19709
  return this;
@@ -19740,7 +19713,7 @@
19740
19713
  * Setup mocha with the given setting options.
19741
19714
  */
19742
19715
 
19743
- mocha.setup = function(opts) {
19716
+ mocha.setup = function (opts) {
19744
19717
  if (typeof opts === 'string') {
19745
19718
  opts = {ui: opts};
19746
19719
  }
@@ -19749,10 +19722,10 @@
19749
19722
  }
19750
19723
  var self = this;
19751
19724
  Object.keys(opts)
19752
- .filter(function(opt) {
19725
+ .filter(function (opt) {
19753
19726
  return opt !== 'delay';
19754
19727
  })
19755
- .forEach(function(opt) {
19728
+ .forEach(function (opt) {
19756
19729
  if (Object.prototype.hasOwnProperty.call(opts, opt)) {
19757
19730
  self[opt](opts[opt]);
19758
19731
  }
@@ -19764,7 +19737,7 @@
19764
19737
  * Run mocha, returning the Runner.
19765
19738
  */
19766
19739
 
19767
- mocha.run = function(fn) {
19740
+ mocha.run = function (fn) {
19768
19741
  var options = mocha.options;
19769
19742
  mocha.globals('location');
19770
19743
 
@@ -19779,7 +19752,7 @@
19779
19752
  mocha.invert();
19780
19753
  }
19781
19754
 
19782
- return mocha$1.prototype.run.call(mocha, function(err) {
19755
+ return mocha$1.prototype.run.call(mocha, function (err) {
19783
19756
  // The DOM Document is not available in Web Workers.
19784
19757
  var document = commonjsGlobal.document;
19785
19758
  if (
@@ -19805,10 +19778,20 @@
19805
19778
  /**
19806
19779
  * Expose mocha.
19807
19780
  */
19808
-
19809
19781
  commonjsGlobal.Mocha = mocha$1;
19810
19782
  commonjsGlobal.mocha = mocha;
19811
19783
 
19784
+ // for bundlers: enable `import {describe, it} from 'mocha'`
19785
+ // `bdd` interface only
19786
+ // prettier-ignore
19787
+ [
19788
+ 'describe', 'context', 'it', 'specify',
19789
+ 'xdescribe', 'xcontext', 'xit', 'xspecify',
19790
+ 'before', 'beforeEach', 'afterEach', 'after'
19791
+ ].forEach(function(key) {
19792
+ mocha[key] = commonjsGlobal[key];
19793
+ });
19794
+
19812
19795
  var browserEntry = mocha;
19813
19796
 
19814
19797
  return browserEntry;