mocha 6.1.4 → 6.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/mocha.js CHANGED
@@ -193,7 +193,7 @@ global.mocha = mocha;
193
193
  module.exports = global;
194
194
 
195
195
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
196
- },{"./lib/mocha":14,"_process":69,"browser-stdout":41}],2:[function(require,module,exports){
196
+ },{"./lib/mocha":14,"_process":68,"browser-stdout":41}],2:[function(require,module,exports){
197
197
  (function (process,global){
198
198
  'use strict';
199
199
 
@@ -365,7 +365,7 @@ function notPermitted(err) {
365
365
  }
366
366
 
367
367
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
368
- },{"../../package":90,"../runner":34,"_process":69}],3:[function(require,module,exports){
368
+ },{"../../package":91,"../runner":34,"_process":68}],3:[function(require,module,exports){
369
369
  'use strict';
370
370
 
371
371
  /**
@@ -1477,7 +1477,7 @@ exports.Test = require('./test');
1477
1477
  * @param {boolean} [options.ignoreLeaks] - Ignore global leaks?
1478
1478
  * @param {boolean} [options.invert] - Invert test filter matches?
1479
1479
  * @param {boolean} [options.noHighlighting] - Disable syntax highlighting?
1480
- * @param {string} [options.reporter] - Reporter name.
1480
+ * @param {string|constructor} [options.reporter] - Reporter name or constructor.
1481
1481
  * @param {Object} [options.reporterOption] - Reporter settings object.
1482
1482
  * @param {number} [options.retries] - Number of times to retry failed tests.
1483
1483
  * @param {number} [options.slow] - Slow threshold value.
@@ -1500,6 +1500,10 @@ function Mocha(options) {
1500
1500
  options.color = 'color' in options ? options.color : options.useColors;
1501
1501
  }
1502
1502
 
1503
+ // Globals are passed in as options.global, with options.globals for backward compatibility.
1504
+ options.globals = options.global || options.globals || [];
1505
+ delete options.global;
1506
+
1503
1507
  this.grep(options.grep)
1504
1508
  .fgrep(options.fgrep)
1505
1509
  .ui(options.ui)
@@ -1553,7 +1557,7 @@ function Mocha(options) {
1553
1557
  * Enables or disables bailing on the first failure.
1554
1558
  *
1555
1559
  * @public
1556
- * @see {@link https://mochajs.org/#-b---bail|CLI option}
1560
+ * @see {@link /#-bail-b|CLI option}
1557
1561
  * @param {boolean} [bail=true] - Whether to bail on first error.
1558
1562
  * @returns {Mocha} this
1559
1563
  * @chainable
@@ -1574,7 +1578,7 @@ Mocha.prototype.bail = function(bail) {
1574
1578
  * Useful for generic setup code that must be included within test suite.
1575
1579
  *
1576
1580
  * @public
1577
- * @see {@link https://mochajs.org/#--file-file|CLI option}
1581
+ * @see {@link /#-file-filedirectoryglob|CLI option}
1578
1582
  * @param {string} file - Pathname of file to be loaded.
1579
1583
  * @returns {Mocha} this
1580
1584
  * @chainable
@@ -1588,8 +1592,8 @@ Mocha.prototype.addFile = function(file) {
1588
1592
  * Sets reporter to `reporter`, defaults to "spec".
1589
1593
  *
1590
1594
  * @public
1591
- * @see {@link https://mochajs.org/#-r---reporter-name|CLI option}
1592
- * @see {@link https://mochajs.org/#reporters|Reporters}
1595
+ * @see {@link /#-reporter-name-r-name|CLI option}
1596
+ * @see {@link /#reporters|Reporters}
1593
1597
  * @param {String|Function} reporter - Reporter name or constructor.
1594
1598
  * @param {Object} [reporterOptions] - Options used to configure the reporter.
1595
1599
  * @returns {Mocha} this
@@ -1655,8 +1659,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions) {
1655
1659
  * Sets test UI `name`, defaults to "bdd".
1656
1660
  *
1657
1661
  * @public
1658
- * @see {@link https://mochajs.org/#-u---ui-name|CLI option}
1659
- * @see {@link https://mochajs.org/#interfaces|Interface DSLs}
1662
+ * @see {@link /#-ui-name-u-name|CLI option}
1663
+ * @see {@link /#interfaces|Interface DSLs}
1660
1664
  * @param {string|Function} [ui=bdd] - Interface name or class.
1661
1665
  * @returns {Mocha} this
1662
1666
  * @chainable
@@ -1794,7 +1798,7 @@ Mocha.prototype.fgrep = function(str) {
1794
1798
  * <strong>Previous filter value will be overwritten on each call!</strong>
1795
1799
  *
1796
1800
  * @public
1797
- * @see {@link https://mochajs.org/#-g---grep-pattern|CLI option}
1801
+ * @see {@link /#grep-regexp-g-regexp|CLI option}
1798
1802
  * @see {@link Mocha#fgrep}
1799
1803
  * @see {@link Mocha#invert}
1800
1804
  * @param {RegExp|String} re - Regular expression used to select tests.
@@ -1864,7 +1868,7 @@ Mocha.prototype.ignoreLeaks = function(ignoreLeaks) {
1864
1868
  * Enables checking for global variables leaked while running tests.
1865
1869
  *
1866
1870
  * @public
1867
- * @see {@link https://mochajs.org/#--check-leaks|CLI option}
1871
+ * @see {@link /#-check-leaks|CLI option}
1868
1872
  * @see {@link Mocha#ignoreLeaks}
1869
1873
  * @return {Mocha} this
1870
1874
  * @chainable
@@ -1934,7 +1938,7 @@ Mocha.prototype._growl = growl.notify;
1934
1938
  * Specifies whitelist of variable names to be expected in global scope.
1935
1939
  *
1936
1940
  * @public
1937
- * @see {@link https://mochajs.org/#--globals-names|CLI option}
1941
+ * @see {@link /#-global-variable-name|CLI option}
1938
1942
  * @see {@link Mocha#checkLeaks}
1939
1943
  * @param {String[]|String} globals - Accepted global variable name(s).
1940
1944
  * @return {Mocha} this
@@ -1945,9 +1949,12 @@ Mocha.prototype._growl = growl.notify;
1945
1949
  * mocha.globals(['jQuery', 'MyLib']);
1946
1950
  */
1947
1951
  Mocha.prototype.globals = function(globals) {
1948
- this.options.globals = (this.options.globals || [])
1952
+ this.options.globals = this.options.globals
1949
1953
  .concat(globals)
1950
- .filter(Boolean);
1954
+ .filter(Boolean)
1955
+ .filter(function(elt, idx, arr) {
1956
+ return arr.indexOf(elt) === idx;
1957
+ });
1951
1958
  return this;
1952
1959
  };
1953
1960
 
@@ -2002,9 +2009,8 @@ Mocha.prototype.hideDiff = function(hideDiff) {
2002
2009
  * If the value is `0`, timeouts will be disabled.
2003
2010
  *
2004
2011
  * @public
2005
- * @see {@link https://mochajs.org/#-t---timeout-ms|CLI option}
2006
- * @see {@link https://mochajs.org/#--no-timeouts|CLI option}
2007
- * @see {@link https://mochajs.org/#timeouts|Timeouts}
2012
+ * @see {@link /#-timeout-ms-t-ms|CLI option}
2013
+ * @see {@link /#timeouts|Timeouts}
2008
2014
  * @see {@link Mocha#enableTimeouts}
2009
2015
  * @param {number|string} msecs - Timeout threshold value.
2010
2016
  * @return {Mocha} this
@@ -2027,7 +2033,7 @@ Mocha.prototype.timeout = function(msecs) {
2027
2033
  * Sets the number of times to retry failed tests.
2028
2034
  *
2029
2035
  * @public
2030
- * @see {@link https://mochajs.org/#retry-tests|Retry Tests}
2036
+ * @see {@link /#retry-tests|Retry Tests}
2031
2037
  * @param {number} retry - Number of times to retry failed tests.
2032
2038
  * @return {Mocha} this
2033
2039
  * @chainable
@@ -2045,7 +2051,7 @@ Mocha.prototype.retries = function(n) {
2045
2051
  * Sets slowness threshold value.
2046
2052
  *
2047
2053
  * @public
2048
- * @see {@link https://mochajs.org/#-s---slow-ms|CLI option}
2054
+ * @see {@link /#-slow-ms-s-ms|CLI option}
2049
2055
  * @param {number} msecs - Slowness threshold value.
2050
2056
  * @return {Mocha} this
2051
2057
  * @chainable
@@ -2067,8 +2073,7 @@ Mocha.prototype.slow = function(msecs) {
2067
2073
  * Enables or disables timeouts.
2068
2074
  *
2069
2075
  * @public
2070
- * @see {@link https://mochajs.org/#-t---timeout-ms|CLI option}
2071
- * @see {@link https://mochajs.org/#--no-timeouts|CLI option}
2076
+ * @see {@link /#-timeout-ms-t-ms|CLI option}
2072
2077
  * @param {boolean} enableTimeouts - Whether to enable timeouts.
2073
2078
  * @return {Mocha} this
2074
2079
  * @chainable
@@ -2124,7 +2129,7 @@ Mocha.prototype.allowUncaught = function() {
2124
2129
  * Used to perform asynch operations before any suites are run.
2125
2130
  *
2126
2131
  * @public
2127
- * @see {@link https://mochajs.org/#delayed-root-suite|delayed root suite}
2132
+ * @see {@link /#delayed-root-suite|delayed root suite}
2128
2133
  * @returns {Mocha} this
2129
2134
  * @chainable
2130
2135
  */
@@ -2237,7 +2242,7 @@ Mocha.prototype.run = function(fn) {
2237
2242
  };
2238
2243
 
2239
2244
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2240
- },{"../package.json":90,"./context":5,"./errors":6,"./growl":2,"./hook":7,"./interfaces":11,"./mocharc.json":15,"./reporters":21,"./runnable":33,"./runner":34,"./stats-collector":35,"./suite":36,"./test":37,"./utils":38,"_process":69,"escape-string-regexp":49,"path":42}],15:[function(require,module,exports){
2245
+ },{"../package.json":91,"./context":5,"./errors":6,"./growl":2,"./hook":7,"./interfaces":11,"./mocharc.json":15,"./reporters":21,"./runnable":33,"./runner":34,"./stats-collector":35,"./suite":36,"./test":37,"./utils":38,"_process":68,"escape-string-regexp":49,"path":42}],15:[function(require,module,exports){
2241
2246
  module.exports={
2242
2247
  "diff": true,
2243
2248
  "extension": ["js"],
@@ -2292,7 +2297,12 @@ exports = module.exports = Base;
2292
2297
  * Check if both stdio streams are associated with a tty.
2293
2298
  */
2294
2299
 
2295
- var isatty = tty.isatty(1) && tty.isatty(2);
2300
+ var isatty = process.stdout.isTTY && process.stderr.isTTY;
2301
+
2302
+ /**
2303
+ * Save log references to avoid tests interfering (see GH-3604).
2304
+ */
2305
+ var consoleLog = console.log;
2296
2306
 
2297
2307
  /**
2298
2308
  * Enable coloring by default, except in the browser interface.
@@ -2459,7 +2469,8 @@ var generateDiff = (exports.generateDiff = function(actual, expected) {
2459
2469
  * Error property
2460
2470
  */
2461
2471
  exports.list = function(failures) {
2462
- console.log();
2472
+ var multipleErr, multipleTest;
2473
+ Base.consoleLog();
2463
2474
  failures.forEach(function(test, i) {
2464
2475
  // format
2465
2476
  var fmt =
@@ -2469,7 +2480,16 @@ exports.list = function(failures) {
2469
2480
 
2470
2481
  // msg
2471
2482
  var msg;
2472
- var err = test.err;
2483
+ var err;
2484
+ if (test.err && test.err.multiple) {
2485
+ if (multipleTest !== test) {
2486
+ multipleTest = test;
2487
+ multipleErr = [test.err].concat(test.err.multiple);
2488
+ }
2489
+ err = multipleErr.shift();
2490
+ } else {
2491
+ err = test.err;
2492
+ }
2473
2493
  var message;
2474
2494
  if (err.message && typeof err.message.toString === 'function') {
2475
2495
  message = err.message + '';
@@ -2520,7 +2540,7 @@ exports.list = function(failures) {
2520
2540
  testTitle += str;
2521
2541
  });
2522
2542
 
2523
- console.log(fmt, i + 1, testTitle, msg, stack);
2543
+ Base.consoleLog(fmt, i + 1, testTitle, msg, stack);
2524
2544
  });
2525
2545
  };
2526
2546
 
@@ -2560,7 +2580,12 @@ function Base(runner, options) {
2560
2580
  if (showDiff(err)) {
2561
2581
  stringifyDiffObjs(err);
2562
2582
  }
2563
- test.err = err;
2583
+ // more than one error per test
2584
+ if (test.err && err instanceof Error) {
2585
+ test.err.multiple = (test.err.multiple || []).concat(err);
2586
+ } else {
2587
+ test.err = err;
2588
+ }
2564
2589
  failures.push(test);
2565
2590
  });
2566
2591
  }
@@ -2569,13 +2594,13 @@ function Base(runner, options) {
2569
2594
  * Outputs common epilogue used by many of the bundled reporters.
2570
2595
  *
2571
2596
  * @public
2572
- * @memberof Mocha.reporters.Base
2597
+ * @memberof Mocha.reporters
2573
2598
  */
2574
2599
  Base.prototype.epilogue = function() {
2575
2600
  var stats = this.stats;
2576
2601
  var fmt;
2577
2602
 
2578
- console.log();
2603
+ Base.consoleLog();
2579
2604
 
2580
2605
  // passes
2581
2606
  fmt =
@@ -2583,26 +2608,26 @@ Base.prototype.epilogue = function() {
2583
2608
  color('green', ' %d passing') +
2584
2609
  color('light', ' (%s)');
2585
2610
 
2586
- console.log(fmt, stats.passes || 0, milliseconds(stats.duration));
2611
+ Base.consoleLog(fmt, stats.passes || 0, milliseconds(stats.duration));
2587
2612
 
2588
2613
  // pending
2589
2614
  if (stats.pending) {
2590
2615
  fmt = color('pending', ' ') + color('pending', ' %d pending');
2591
2616
 
2592
- console.log(fmt, stats.pending);
2617
+ Base.consoleLog(fmt, stats.pending);
2593
2618
  }
2594
2619
 
2595
2620
  // failures
2596
2621
  if (stats.failures) {
2597
2622
  fmt = color('fail', ' %d failing');
2598
2623
 
2599
- console.log(fmt, stats.failures);
2624
+ Base.consoleLog(fmt, stats.failures);
2600
2625
 
2601
2626
  Base.list(this.failures);
2602
- console.log();
2627
+ Base.consoleLog();
2603
2628
  }
2604
2629
 
2605
- console.log();
2630
+ Base.consoleLog();
2606
2631
  };
2607
2632
 
2608
2633
  /**
@@ -2755,10 +2780,12 @@ function sameType(a, b) {
2755
2780
  return objToString.call(a) === objToString.call(b);
2756
2781
  }
2757
2782
 
2783
+ Base.consoleLog = consoleLog;
2784
+
2758
2785
  Base.abstract = true;
2759
2786
 
2760
2787
  }).call(this,require('_process'))
2761
- },{"../runner":34,"../utils":38,"_process":69,"diff":48,"ms":60,"supports-color":42,"tty":4}],18:[function(require,module,exports){
2788
+ },{"../runner":34,"../utils":38,"_process":68,"diff":48,"ms":59,"supports-color":42,"tty":4}],18:[function(require,module,exports){
2762
2789
  'use strict';
2763
2790
  /**
2764
2791
  * @module Doc
@@ -2805,41 +2832,45 @@ function Doc(runner, options) {
2805
2832
  return;
2806
2833
  }
2807
2834
  ++indents;
2808
- console.log('%s<section class="suite">', indent());
2835
+ Base.consoleLog('%s<section class="suite">', indent());
2809
2836
  ++indents;
2810
- console.log('%s<h1>%s</h1>', indent(), utils.escape(suite.title));
2811
- console.log('%s<dl>', indent());
2837
+ Base.consoleLog('%s<h1>%s</h1>', indent(), utils.escape(suite.title));
2838
+ Base.consoleLog('%s<dl>', indent());
2812
2839
  });
2813
2840
 
2814
2841
  runner.on(EVENT_SUITE_END, function(suite) {
2815
2842
  if (suite.root) {
2816
2843
  return;
2817
2844
  }
2818
- console.log('%s</dl>', indent());
2845
+ Base.consoleLog('%s</dl>', indent());
2819
2846
  --indents;
2820
- console.log('%s</section>', indent());
2847
+ Base.consoleLog('%s</section>', indent());
2821
2848
  --indents;
2822
2849
  });
2823
2850
 
2824
2851
  runner.on(EVENT_TEST_PASS, function(test) {
2825
- console.log('%s <dt>%s</dt>', indent(), utils.escape(test.title));
2852
+ Base.consoleLog('%s <dt>%s</dt>', indent(), utils.escape(test.title));
2826
2853
  var code = utils.escape(utils.clean(test.body));
2827
- console.log('%s <dd><pre><code>%s</code></pre></dd>', indent(), code);
2854
+ Base.consoleLog('%s <dd><pre><code>%s</code></pre></dd>', indent(), code);
2828
2855
  });
2829
2856
 
2830
2857
  runner.on(EVENT_TEST_FAIL, function(test, err) {
2831
- console.log(
2858
+ Base.consoleLog(
2832
2859
  '%s <dt class="error">%s</dt>',
2833
2860
  indent(),
2834
2861
  utils.escape(test.title)
2835
2862
  );
2836
2863
  var code = utils.escape(utils.clean(test.body));
2837
- console.log(
2864
+ Base.consoleLog(
2838
2865
  '%s <dd class="error"><pre><code>%s</code></pre></dd>',
2839
2866
  indent(),
2840
2867
  code
2841
2868
  );
2842
- console.log('%s <dd class="error">%s</dd>', indent(), utils.escape(err));
2869
+ Base.consoleLog(
2870
+ '%s <dd class="error">%s</dd>',
2871
+ indent(),
2872
+ utils.escape(err)
2873
+ );
2843
2874
  });
2844
2875
  }
2845
2876
 
@@ -2917,7 +2948,7 @@ function Dot(runner, options) {
2917
2948
  });
2918
2949
 
2919
2950
  runner.once(EVENT_RUN_END, function() {
2920
- console.log();
2951
+ process.stdout.write('\n');
2921
2952
  self.epilogue();
2922
2953
  });
2923
2954
  }
@@ -2930,7 +2961,7 @@ inherits(Dot, Base);
2930
2961
  Dot.description = 'dot matrix representation';
2931
2962
 
2932
2963
  }).call(this,require('_process'))
2933
- },{"../runner":34,"../utils":38,"./base":17,"_process":69}],20:[function(require,module,exports){
2964
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68}],20:[function(require,module,exports){
2934
2965
  (function (global){
2935
2966
  'use strict';
2936
2967
 
@@ -3291,8 +3322,8 @@ function hideSuitesWithout(classname) {
3291
3322
  */
3292
3323
  function unhide() {
3293
3324
  var els = document.getElementsByClassName('suite hidden');
3294
- for (var i = 0; i < els.length; ++i) {
3295
- els[i].className = els[i].className.replace('suite hidden', 'suite');
3325
+ while (els.length > 0) {
3326
+ els[0].className = els[0].className.replace('suite hidden', 'suite');
3296
3327
  }
3297
3328
  }
3298
3329
 
@@ -3439,7 +3470,7 @@ function clean(test) {
3439
3470
  JSONStream.description = 'newline delimited JSON events';
3440
3471
 
3441
3472
  }).call(this,require('_process'))
3442
- },{"../runner":34,"./base":17,"_process":69}],23:[function(require,module,exports){
3473
+ },{"../runner":34,"./base":17,"_process":68}],23:[function(require,module,exports){
3443
3474
  (function (process){
3444
3475
  'use strict';
3445
3476
  /**
@@ -3578,7 +3609,7 @@ function errorJSON(err) {
3578
3609
  JSONReporter.description = 'single JSON object';
3579
3610
 
3580
3611
  }).call(this,require('_process'))
3581
- },{"../runner":34,"./base":17,"_process":69}],24:[function(require,module,exports){
3612
+ },{"../runner":34,"./base":17,"_process":68}],24:[function(require,module,exports){
3582
3613
  (function (process){
3583
3614
  'use strict';
3584
3615
  /**
@@ -3677,7 +3708,7 @@ function Landing(runner, options) {
3677
3708
 
3678
3709
  runner.once(EVENT_RUN_END, function() {
3679
3710
  cursor.show();
3680
- console.log();
3711
+ process.stdout.write('\n');
3681
3712
  self.epilogue();
3682
3713
  });
3683
3714
  }
@@ -3690,7 +3721,7 @@ inherits(Landing, Base);
3690
3721
  Landing.description = 'Unicode landing strip';
3691
3722
 
3692
3723
  }).call(this,require('_process'))
3693
- },{"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":69}],25:[function(require,module,exports){
3724
+ },{"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":68}],25:[function(require,module,exports){
3694
3725
  (function (process){
3695
3726
  'use strict';
3696
3727
  /**
@@ -3735,7 +3766,7 @@ function List(runner, options) {
3735
3766
  var n = 0;
3736
3767
 
3737
3768
  runner.on(EVENT_RUN_BEGIN, function() {
3738
- console.log();
3769
+ Base.consoleLog();
3739
3770
  });
3740
3771
 
3741
3772
  runner.on(EVENT_TEST_BEGIN, function(test) {
@@ -3744,7 +3775,7 @@ function List(runner, options) {
3744
3775
 
3745
3776
  runner.on(EVENT_TEST_PENDING, function(test) {
3746
3777
  var fmt = color('checkmark', ' -') + color('pending', ' %s');
3747
- console.log(fmt, test.fullTitle());
3778
+ Base.consoleLog(fmt, test.fullTitle());
3748
3779
  });
3749
3780
 
3750
3781
  runner.on(EVENT_TEST_PASS, function(test) {
@@ -3753,12 +3784,12 @@ function List(runner, options) {
3753
3784
  color('pass', ' %s: ') +
3754
3785
  color(test.speed, '%dms');
3755
3786
  cursor.CR();
3756
- console.log(fmt, test.fullTitle(), test.duration);
3787
+ Base.consoleLog(fmt, test.fullTitle(), test.duration);
3757
3788
  });
3758
3789
 
3759
3790
  runner.on(EVENT_TEST_FAIL, function(test) {
3760
3791
  cursor.CR();
3761
- console.log(color('fail', ' %d) %s'), ++n, test.fullTitle());
3792
+ Base.consoleLog(color('fail', ' %d) %s'), ++n, test.fullTitle());
3762
3793
  });
3763
3794
 
3764
3795
  runner.once(EVENT_RUN_END, self.epilogue.bind(self));
@@ -3772,7 +3803,7 @@ inherits(List, Base);
3772
3803
  List.description = 'like "spec" reporter but flat';
3773
3804
 
3774
3805
  }).call(this,require('_process'))
3775
- },{"../runner":34,"../utils":38,"./base":17,"_process":69}],26:[function(require,module,exports){
3806
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68}],26:[function(require,module,exports){
3776
3807
  (function (process){
3777
3808
  'use strict';
3778
3809
  /**
@@ -3888,7 +3919,7 @@ function Markdown(runner, options) {
3888
3919
  Markdown.description = 'GitHub Flavored Markdown';
3889
3920
 
3890
3921
  }).call(this,require('_process'))
3891
- },{"../runner":34,"../utils":38,"./base":17,"_process":69}],27:[function(require,module,exports){
3922
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68}],27:[function(require,module,exports){
3892
3923
  (function (process){
3893
3924
  'use strict';
3894
3925
  /**
@@ -3944,7 +3975,7 @@ inherits(Min, Base);
3944
3975
  Min.description = 'essentially just a summary';
3945
3976
 
3946
3977
  }).call(this,require('_process'))
3947
- },{"../runner":34,"../utils":38,"./base":17,"_process":69}],28:[function(require,module,exports){
3978
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68}],28:[function(require,module,exports){
3948
3979
  (function (process){
3949
3980
  'use strict';
3950
3981
  /**
@@ -4224,7 +4255,7 @@ function write(string) {
4224
4255
  NyanCat.description = '"nyan cat"';
4225
4256
 
4226
4257
  }).call(this,require('_process'))
4227
- },{"../runner":34,"../utils":38,"./base":17,"_process":69}],29:[function(require,module,exports){
4258
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68}],29:[function(require,module,exports){
4228
4259
  (function (process){
4229
4260
  'use strict';
4230
4261
  /**
@@ -4286,7 +4317,7 @@ function Progress(runner, options) {
4286
4317
 
4287
4318
  // tests started
4288
4319
  runner.on(EVENT_RUN_BEGIN, function() {
4289
- console.log();
4320
+ process.stdout.write('\n');
4290
4321
  cursor.hide();
4291
4322
  });
4292
4323
 
@@ -4319,7 +4350,7 @@ function Progress(runner, options) {
4319
4350
  // and the failures if any
4320
4351
  runner.once(EVENT_RUN_END, function() {
4321
4352
  cursor.show();
4322
- console.log();
4353
+ process.stdout.write('\n');
4323
4354
  self.epilogue();
4324
4355
  });
4325
4356
  }
@@ -4332,7 +4363,7 @@ inherits(Progress, Base);
4332
4363
  Progress.description = 'a progress bar';
4333
4364
 
4334
4365
  }).call(this,require('_process'))
4335
- },{"../runner":34,"../utils":38,"./base":17,"_process":69}],30:[function(require,module,exports){
4366
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68}],30:[function(require,module,exports){
4336
4367
  'use strict';
4337
4368
  /**
4338
4369
  * @module Spec
@@ -4381,24 +4412,24 @@ function Spec(runner, options) {
4381
4412
  }
4382
4413
 
4383
4414
  runner.on(EVENT_RUN_BEGIN, function() {
4384
- console.log();
4415
+ Base.consoleLog();
4385
4416
  });
4386
4417
 
4387
4418
  runner.on(EVENT_SUITE_BEGIN, function(suite) {
4388
4419
  ++indents;
4389
- console.log(color('suite', '%s%s'), indent(), suite.title);
4420
+ Base.consoleLog(color('suite', '%s%s'), indent(), suite.title);
4390
4421
  });
4391
4422
 
4392
4423
  runner.on(EVENT_SUITE_END, function() {
4393
4424
  --indents;
4394
4425
  if (indents === 1) {
4395
- console.log();
4426
+ Base.consoleLog();
4396
4427
  }
4397
4428
  });
4398
4429
 
4399
4430
  runner.on(EVENT_TEST_PENDING, function(test) {
4400
4431
  var fmt = indent() + color('pending', ' - %s');
4401
- console.log(fmt, test.title);
4432
+ Base.consoleLog(fmt, test.title);
4402
4433
  });
4403
4434
 
4404
4435
  runner.on(EVENT_TEST_PASS, function(test) {
@@ -4408,19 +4439,19 @@ function Spec(runner, options) {
4408
4439
  indent() +
4409
4440
  color('checkmark', ' ' + Base.symbols.ok) +
4410
4441
  color('pass', ' %s');
4411
- console.log(fmt, test.title);
4442
+ Base.consoleLog(fmt, test.title);
4412
4443
  } else {
4413
4444
  fmt =
4414
4445
  indent() +
4415
4446
  color('checkmark', ' ' + Base.symbols.ok) +
4416
4447
  color('pass', ' %s') +
4417
4448
  color(test.speed, ' (%dms)');
4418
- console.log(fmt, test.title, test.duration);
4449
+ Base.consoleLog(fmt, test.title, test.duration);
4419
4450
  }
4420
4451
  });
4421
4452
 
4422
4453
  runner.on(EVENT_TEST_FAIL, function(test) {
4423
- console.log(indent() + color('fail', ' %d) %s'), ++n, test.title);
4454
+ Base.consoleLog(indent() + color('fail', ' %d) %s'), ++n, test.title);
4424
4455
  });
4425
4456
 
4426
4457
  runner.once(EVENT_RUN_END, self.epilogue.bind(self));
@@ -4731,7 +4762,7 @@ inherits(TAP13Producer, TAPProducer);
4731
4762
  TAP.description = 'TAP-compatible output';
4732
4763
 
4733
4764
  }).call(this,require('_process'))
4734
- },{"../runner":34,"../utils":38,"./base":17,"_process":69,"util":89}],32:[function(require,module,exports){
4765
+ },{"../runner":34,"../utils":38,"./base":17,"_process":68,"util":90}],32:[function(require,module,exports){
4735
4766
  (function (process,global){
4736
4767
  'use strict';
4737
4768
  /**
@@ -4877,7 +4908,7 @@ XUnit.prototype.write = function(line) {
4877
4908
  } else if (typeof process === 'object' && process.stdout) {
4878
4909
  process.stdout.write(line + '\n');
4879
4910
  } else {
4880
- console.log(line);
4911
+ Base.consoleLog(line);
4881
4912
  }
4882
4913
  };
4883
4914
 
@@ -4951,7 +4982,7 @@ function tag(name, attrs, close, content) {
4951
4982
  XUnit.description = 'XUnit-compatible XML output';
4952
4983
 
4953
4984
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4954
- },{"../errors":6,"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":69,"fs":42,"mkdirp":59,"path":42}],33:[function(require,module,exports){
4985
+ },{"../errors":6,"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":68,"fs":42,"mkdirp":58,"path":42}],33:[function(require,module,exports){
4955
4986
  (function (global){
4956
4987
  'use strict';
4957
4988
 
@@ -5451,7 +5482,7 @@ Runnable.toValueOrError = function(value) {
5451
5482
  Runnable.constants = constants;
5452
5483
 
5453
5484
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5454
- },{"./errors":6,"./pending":16,"./utils":38,"debug":45,"events":50,"ms":60}],34:[function(require,module,exports){
5485
+ },{"./errors":6,"./pending":16,"./utils":38,"debug":45,"events":50,"ms":59}],34:[function(require,module,exports){
5455
5486
  (function (process,global){
5456
5487
  'use strict';
5457
5488
 
@@ -5596,7 +5627,7 @@ function Runner(suite, delay) {
5596
5627
  });
5597
5628
  this._defaultGrep = /.*/;
5598
5629
  this.grep(this._defaultGrep);
5599
- this.globals(this.globalProps().concat(extraGlobals()));
5630
+ this.globals(this.globalProps());
5600
5631
  }
5601
5632
 
5602
5633
  /**
@@ -6320,7 +6351,7 @@ Runner.prototype.uncaught = function(err) {
6320
6351
  }
6321
6352
 
6322
6353
  // bail
6323
- this.emit(constants.EVENT_RUN_END);
6354
+ this.abort();
6324
6355
  };
6325
6356
 
6326
6357
  /**
@@ -6471,30 +6502,6 @@ function thrown2Error(err) {
6471
6502
  );
6472
6503
  }
6473
6504
 
6474
- /**
6475
- * Array of globals dependent on the environment.
6476
- *
6477
- * @return {Array}
6478
- * @deprecated
6479
- * @todo remove; long since unsupported
6480
- * @private
6481
- */
6482
- function extraGlobals() {
6483
- if (typeof process === 'object' && typeof process.version === 'string') {
6484
- var parts = process.version.split('.');
6485
- var nodeVersion = parts.reduce(function(a, v) {
6486
- return (a << 8) | v;
6487
- });
6488
-
6489
- // 'errno' was renamed to process._errno in v0.9.11.
6490
- if (nodeVersion < 0x00090b) {
6491
- return ['errno'];
6492
- }
6493
- }
6494
-
6495
- return [];
6496
- }
6497
-
6498
6505
  Runner.constants = constants;
6499
6506
 
6500
6507
  /**
@@ -6504,7 +6511,7 @@ Runner.constants = constants;
6504
6511
  */
6505
6512
 
6506
6513
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
6507
- },{"./errors":6,"./pending":16,"./runnable":33,"./suite":36,"./utils":38,"_process":69,"debug":45,"events":50,"util":89}],35:[function(require,module,exports){
6514
+ },{"./errors":6,"./pending":16,"./runnable":33,"./suite":36,"./utils":38,"_process":68,"debug":45,"events":50,"util":90}],35:[function(require,module,exports){
6508
6515
  (function (global){
6509
6516
  'use strict';
6510
6517
 
@@ -7235,7 +7242,7 @@ var deprecatedEvents = Object.keys(constants)
7235
7242
 
7236
7243
  Suite.constants = constants;
7237
7244
 
7238
- },{"./errors":6,"./hook":7,"./utils":38,"debug":45,"events":50,"ms":60}],37:[function(require,module,exports){
7245
+ },{"./errors":6,"./hook":7,"./utils":38,"debug":45,"events":50,"ms":59}],37:[function(require,module,exports){
7239
7246
  'use strict';
7240
7247
  var Runnable = require('./runnable');
7241
7248
  var utils = require('./utils');
@@ -7854,32 +7861,41 @@ function isHiddenOnUnix(pathname) {
7854
7861
  *
7855
7862
  * @public
7856
7863
  * @memberof Mocha.utils
7857
- * @todo Fix extension handling
7858
7864
  * @param {string} filepath - Base path to start searching from.
7859
- * @param {string[]} extensions - File extensions to look for.
7860
- * @param {boolean} recursive - Whether to recurse into subdirectories.
7865
+ * @param {string[]} [extensions=[]] - File extensions to look for.
7866
+ * @param {boolean} [recursive=false] - Whether to recurse into subdirectories.
7861
7867
  * @return {string[]} An array of paths.
7862
7868
  * @throws {Error} if no files match pattern.
7863
7869
  * @throws {TypeError} if `filepath` is directory and `extensions` not provided.
7864
7870
  */
7865
7871
  exports.lookupFiles = function lookupFiles(filepath, extensions, recursive) {
7872
+ extensions = extensions || [];
7873
+ recursive = recursive || false;
7866
7874
  var files = [];
7867
7875
  var stat;
7868
7876
 
7869
7877
  if (!fs.existsSync(filepath)) {
7870
- if (fs.existsSync(filepath + '.js')) {
7871
- filepath += '.js';
7878
+ var pattern;
7879
+ if (glob.hasMagic(filepath)) {
7880
+ // Handle glob as is without extensions
7881
+ pattern = filepath;
7872
7882
  } else {
7873
- // Handle glob
7874
- files = glob.sync(filepath);
7875
- if (!files.length) {
7876
- throw createNoFilesMatchPatternError(
7877
- 'Cannot find any files matching pattern ' + exports.dQuote(filepath),
7878
- filepath
7879
- );
7880
- }
7881
- return files;
7883
+ // glob pattern e.g. 'filepath+(.js|.ts)'
7884
+ var strExtensions = extensions
7885
+ .map(function(v) {
7886
+ return '.' + v;
7887
+ })
7888
+ .join('|');
7889
+ pattern = filepath + '+(' + strExtensions + ')';
7890
+ }
7891
+ files = glob.sync(pattern, {nodir: true});
7892
+ if (!files.length) {
7893
+ throw createNoFilesMatchPatternError(
7894
+ 'Cannot find any files matching pattern ' + exports.dQuote(filepath),
7895
+ filepath
7896
+ );
7882
7897
  }
7898
+ return files;
7883
7899
  }
7884
7900
 
7885
7901
  // Handle file
@@ -7910,7 +7926,7 @@ exports.lookupFiles = function lookupFiles(filepath, extensions, recursive) {
7910
7926
  // ignore error
7911
7927
  return;
7912
7928
  }
7913
- if (!extensions) {
7929
+ if (!extensions.length) {
7914
7930
  throw createMissingArgumentError(
7915
7931
  util.format(
7916
7932
  'Argument %s required when argument %s is a directory',
@@ -8006,7 +8022,8 @@ exports.stackTraceFilter = function() {
8006
8022
  function isMochaInternal(line) {
8007
8023
  return (
8008
8024
  ~line.indexOf('node_modules' + slash + 'mocha' + slash) ||
8009
- ~line.indexOf(slash + 'mocha.js')
8025
+ ~line.indexOf(slash + 'mocha.js') ||
8026
+ ~line.indexOf(slash + 'mocha.min.js')
8010
8027
  );
8011
8028
  }
8012
8029
 
@@ -8189,7 +8206,7 @@ exports.defineConstants = function(obj) {
8189
8206
  };
8190
8207
 
8191
8208
  }).call(this,require('_process'),require("buffer").Buffer)
8192
- },{"./errors":6,"_process":69,"buffer":43,"debug":45,"fs":42,"glob":42,"he":54,"object.assign":65,"path":42,"util":89}],39:[function(require,module,exports){
8209
+ },{"./errors":6,"_process":68,"buffer":43,"debug":45,"fs":42,"glob":42,"he":54,"object.assign":64,"path":42,"util":90}],39:[function(require,module,exports){
8193
8210
  'use strict'
8194
8211
 
8195
8212
  exports.byteLength = byteLength
@@ -8257,7 +8274,8 @@ function toByteArray (b64) {
8257
8274
  ? validLen - 4
8258
8275
  : validLen
8259
8276
 
8260
- for (var i = 0; i < len; i += 4) {
8277
+ var i
8278
+ for (i = 0; i < len; i += 4) {
8261
8279
  tmp =
8262
8280
  (revLookup[b64.charCodeAt(i)] << 18) |
8263
8281
  (revLookup[b64.charCodeAt(i + 1)] << 12) |
@@ -8373,7 +8391,7 @@ BrowserStdout.prototype._write = function(chunks, encoding, cb) {
8373
8391
  }
8374
8392
 
8375
8393
  }).call(this,require('_process'))
8376
- },{"_process":69,"stream":84,"util":89}],42:[function(require,module,exports){
8394
+ },{"_process":68,"stream":84,"util":90}],42:[function(require,module,exports){
8377
8395
  arguments[4][40][0].apply(exports,arguments)
8378
8396
  },{"dup":40}],43:[function(require,module,exports){
8379
8397
  (function (Buffer){
@@ -8389,6 +8407,10 @@ arguments[4][40][0].apply(exports,arguments)
8389
8407
 
8390
8408
  var base64 = require('base64-js')
8391
8409
  var ieee754 = require('ieee754')
8410
+ var customInspectSymbol =
8411
+ (typeof Symbol === 'function' && typeof Symbol.for === 'function')
8412
+ ? Symbol.for('nodejs.util.inspect.custom')
8413
+ : null
8392
8414
 
8393
8415
  exports.Buffer = Buffer
8394
8416
  exports.SlowBuffer = SlowBuffer
@@ -8425,7 +8447,9 @@ function typedArraySupport () {
8425
8447
  // Can typed array instances can be augmented?
8426
8448
  try {
8427
8449
  var arr = new Uint8Array(1)
8428
- arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
8450
+ var proto = { foo: function () { return 42 } }
8451
+ Object.setPrototypeOf(proto, Uint8Array.prototype)
8452
+ Object.setPrototypeOf(arr, proto)
8429
8453
  return arr.foo() === 42
8430
8454
  } catch (e) {
8431
8455
  return false
@@ -8454,7 +8478,7 @@ function createBuffer (length) {
8454
8478
  }
8455
8479
  // Return an augmented `Uint8Array` instance
8456
8480
  var buf = new Uint8Array(length)
8457
- buf.__proto__ = Buffer.prototype
8481
+ Object.setPrototypeOf(buf, Buffer.prototype)
8458
8482
  return buf
8459
8483
  }
8460
8484
 
@@ -8504,7 +8528,7 @@ function from (value, encodingOrOffset, length) {
8504
8528
  }
8505
8529
 
8506
8530
  if (value == null) {
8507
- throw TypeError(
8531
+ throw new TypeError(
8508
8532
  'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
8509
8533
  'or Array-like Object. Received type ' + (typeof value)
8510
8534
  )
@@ -8515,6 +8539,12 @@ function from (value, encodingOrOffset, length) {
8515
8539
  return fromArrayBuffer(value, encodingOrOffset, length)
8516
8540
  }
8517
8541
 
8542
+ if (typeof SharedArrayBuffer !== 'undefined' &&
8543
+ (isInstance(value, SharedArrayBuffer) ||
8544
+ (value && isInstance(value.buffer, SharedArrayBuffer)))) {
8545
+ return fromArrayBuffer(value, encodingOrOffset, length)
8546
+ }
8547
+
8518
8548
  if (typeof value === 'number') {
8519
8549
  throw new TypeError(
8520
8550
  'The "value" argument must not be of type number. Received type number'
@@ -8556,8 +8586,8 @@ Buffer.from = function (value, encodingOrOffset, length) {
8556
8586
 
8557
8587
  // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
8558
8588
  // https://github.com/feross/buffer/pull/148
8559
- Buffer.prototype.__proto__ = Uint8Array.prototype
8560
- Buffer.__proto__ = Uint8Array
8589
+ Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
8590
+ Object.setPrototypeOf(Buffer, Uint8Array)
8561
8591
 
8562
8592
  function assertSize (size) {
8563
8593
  if (typeof size !== 'number') {
@@ -8661,7 +8691,8 @@ function fromArrayBuffer (array, byteOffset, length) {
8661
8691
  }
8662
8692
 
8663
8693
  // Return an augmented `Uint8Array` instance
8664
- buf.__proto__ = Buffer.prototype
8694
+ Object.setPrototypeOf(buf, Buffer.prototype)
8695
+
8665
8696
  return buf
8666
8697
  }
8667
8698
 
@@ -8983,6 +9014,9 @@ Buffer.prototype.inspect = function inspect () {
8983
9014
  if (this.length > max) str += ' ... '
8984
9015
  return '<Buffer ' + str + '>'
8985
9016
  }
9017
+ if (customInspectSymbol) {
9018
+ Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
9019
+ }
8986
9020
 
8987
9021
  Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
8988
9022
  if (isInstance(target, Uint8Array)) {
@@ -9108,7 +9142,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
9108
9142
  return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
9109
9143
  }
9110
9144
  }
9111
- return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
9145
+ return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
9112
9146
  }
9113
9147
 
9114
9148
  throw new TypeError('val must be string, number or Buffer')
@@ -9437,7 +9471,7 @@ function hexSlice (buf, start, end) {
9437
9471
 
9438
9472
  var out = ''
9439
9473
  for (var i = start; i < end; ++i) {
9440
- out += toHex(buf[i])
9474
+ out += hexSliceLookupTable[buf[i]]
9441
9475
  }
9442
9476
  return out
9443
9477
  }
@@ -9474,7 +9508,8 @@ Buffer.prototype.slice = function slice (start, end) {
9474
9508
 
9475
9509
  var newBuf = this.subarray(start, end)
9476
9510
  // Return an augmented `Uint8Array` instance
9477
- newBuf.__proto__ = Buffer.prototype
9511
+ Object.setPrototypeOf(newBuf, Buffer.prototype)
9512
+
9478
9513
  return newBuf
9479
9514
  }
9480
9515
 
@@ -9963,6 +9998,8 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
9963
9998
  }
9964
9999
  } else if (typeof val === 'number') {
9965
10000
  val = val & 255
10001
+ } else if (typeof val === 'boolean') {
10002
+ val = Number(val)
9966
10003
  }
9967
10004
 
9968
10005
  // Invalid ranges are not set to a default, so can range check early.
@@ -10020,11 +10057,6 @@ function base64clean (str) {
10020
10057
  return str
10021
10058
  }
10022
10059
 
10023
- function toHex (n) {
10024
- if (n < 16) return '0' + n.toString(16)
10025
- return n.toString(16)
10026
- }
10027
-
10028
10060
  function utf8ToBytes (string, units) {
10029
10061
  units = units || Infinity
10030
10062
  var codePoint
@@ -10155,6 +10187,20 @@ function numberIsNaN (obj) {
10155
10187
  return obj !== obj // eslint-disable-line no-self-compare
10156
10188
  }
10157
10189
 
10190
+ // Create lookup table for `toString('hex')`
10191
+ // See: https://github.com/feross/buffer/issues/219
10192
+ var hexSliceLookupTable = (function () {
10193
+ var alphabet = '0123456789abcdef'
10194
+ var table = new Array(256)
10195
+ for (var i = 0; i < 16; ++i) {
10196
+ var i16 = i * 16
10197
+ for (var j = 0; j < 16; ++j) {
10198
+ table[i16 + j] = alphabet[i] + alphabet[j]
10199
+ }
10200
+ }
10201
+ return table
10202
+ })()
10203
+
10158
10204
  }).call(this,require("buffer").Buffer)
10159
10205
  },{"base64-js":39,"buffer":43,"ieee754":55}],44:[function(require,module,exports){
10160
10206
  (function (Buffer){
@@ -10451,7 +10497,7 @@ formatters.j = function (v) {
10451
10497
 
10452
10498
 
10453
10499
  }).call(this,require('_process'))
10454
- },{"./common":46,"_process":69}],46:[function(require,module,exports){
10500
+ },{"./common":46,"_process":68}],46:[function(require,module,exports){
10455
10501
  "use strict";
10456
10502
 
10457
10503
  /**
@@ -10702,7 +10748,7 @@ function setup(env) {
10702
10748
  module.exports = setup;
10703
10749
 
10704
10750
 
10705
- },{"ms":60}],47:[function(require,module,exports){
10751
+ },{"ms":59}],47:[function(require,module,exports){
10706
10752
  'use strict';
10707
10753
 
10708
10754
  var keys = require('object-keys');
@@ -10762,7 +10808,7 @@ defineProperties.supportsDescriptors = !!supportsDescriptors;
10762
10808
 
10763
10809
  module.exports = defineProperties;
10764
10810
 
10765
- },{"object-keys":62}],48:[function(require,module,exports){
10811
+ },{"object-keys":61}],48:[function(require,module,exports){
10766
10812
  /*!
10767
10813
 
10768
10814
  diff v3.5.0
@@ -13208,7 +13254,7 @@ module.exports = Function.prototype.bind || implementation;
13208
13254
  },{"./implementation":51}],53:[function(require,module,exports){
13209
13255
  'use strict';
13210
13256
 
13211
- /* eslint complexity: [2, 17], max-statements: [2, 33] */
13257
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
13212
13258
  module.exports = function hasSymbols() {
13213
13259
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
13214
13260
  if (typeof Symbol.iterator === 'symbol') { return true; }
@@ -13686,24 +13732,28 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
13686
13732
  if (typeof Object.create === 'function') {
13687
13733
  // implementation from standard node.js 'util' module
13688
13734
  module.exports = function inherits(ctor, superCtor) {
13689
- ctor.super_ = superCtor
13690
- ctor.prototype = Object.create(superCtor.prototype, {
13691
- constructor: {
13692
- value: ctor,
13693
- enumerable: false,
13694
- writable: true,
13695
- configurable: true
13696
- }
13697
- });
13735
+ if (superCtor) {
13736
+ ctor.super_ = superCtor
13737
+ ctor.prototype = Object.create(superCtor.prototype, {
13738
+ constructor: {
13739
+ value: ctor,
13740
+ enumerable: false,
13741
+ writable: true,
13742
+ configurable: true
13743
+ }
13744
+ })
13745
+ }
13698
13746
  };
13699
13747
  } else {
13700
13748
  // old school shim for old browsers
13701
13749
  module.exports = function inherits(ctor, superCtor) {
13702
- ctor.super_ = superCtor
13703
- var TempCtor = function () {}
13704
- TempCtor.prototype = superCtor.prototype
13705
- ctor.prototype = new TempCtor()
13706
- ctor.prototype.constructor = ctor
13750
+ if (superCtor) {
13751
+ ctor.super_ = superCtor
13752
+ var TempCtor = function () {}
13753
+ TempCtor.prototype = superCtor.prototype
13754
+ ctor.prototype = new TempCtor()
13755
+ ctor.prototype.constructor = ctor
13756
+ }
13707
13757
  }
13708
13758
  }
13709
13759
 
@@ -13715,29 +13765,12 @@ if (typeof Object.create === 'function') {
13715
13765
  * @license MIT
13716
13766
  */
13717
13767
 
13718
- // The _isBuffer check is for Safari 5-7 support, because it's missing
13719
- // Object.prototype.constructor. Remove this eventually
13720
- module.exports = function (obj) {
13721
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
13722
- }
13723
-
13724
- function isBuffer (obj) {
13725
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
13726
- }
13727
-
13728
- // For Node v0.10 support. Remove this eventually.
13729
- function isSlowBuffer (obj) {
13730
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
13768
+ module.exports = function isBuffer (obj) {
13769
+ return obj != null && obj.constructor != null &&
13770
+ typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
13731
13771
  }
13732
13772
 
13733
13773
  },{}],58:[function(require,module,exports){
13734
- var toString = {}.toString;
13735
-
13736
- module.exports = Array.isArray || function (arr) {
13737
- return toString.call(arr) == '[object Array]';
13738
- };
13739
-
13740
- },{}],59:[function(require,module,exports){
13741
13774
  (function (process){
13742
13775
  var path = require('path');
13743
13776
  var fs = require('fs');
@@ -13772,6 +13805,7 @@ function mkdirP (p, opts, f, made) {
13772
13805
  }
13773
13806
  switch (er.code) {
13774
13807
  case 'ENOENT':
13808
+ if (path.dirname(p) === p) return cb(er);
13775
13809
  mkdirP(path.dirname(p), opts, function (er, made) {
13776
13810
  if (er) cb(er, made);
13777
13811
  else mkdirP(p, opts, cb, made);
@@ -13839,7 +13873,7 @@ mkdirP.sync = function sync (p, opts, made) {
13839
13873
  };
13840
13874
 
13841
13875
  }).call(this,require('_process'))
13842
- },{"_process":69,"fs":42,"path":42}],60:[function(require,module,exports){
13876
+ },{"_process":68,"fs":42,"path":42}],59:[function(require,module,exports){
13843
13877
  /**
13844
13878
  * Helpers.
13845
13879
  */
@@ -14003,7 +14037,7 @@ function plural(ms, msAbs, n, name) {
14003
14037
  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
14004
14038
  }
14005
14039
 
14006
- },{}],61:[function(require,module,exports){
14040
+ },{}],60:[function(require,module,exports){
14007
14041
  'use strict';
14008
14042
 
14009
14043
  var keysShim;
@@ -14037,6 +14071,8 @@ if (!Object.keys) {
14037
14071
  $frames: true,
14038
14072
  $innerHeight: true,
14039
14073
  $innerWidth: true,
14074
+ $onmozfullscreenchange: true,
14075
+ $onmozfullscreenerror: true,
14040
14076
  $outerHeight: true,
14041
14077
  $outerWidth: true,
14042
14078
  $pageXOffset: true,
@@ -14125,7 +14161,7 @@ if (!Object.keys) {
14125
14161
  }
14126
14162
  module.exports = keysShim;
14127
14163
 
14128
- },{"./isArguments":63}],62:[function(require,module,exports){
14164
+ },{"./isArguments":62}],61:[function(require,module,exports){
14129
14165
  'use strict';
14130
14166
 
14131
14167
  var slice = Array.prototype.slice;
@@ -14159,7 +14195,7 @@ keysShim.shim = function shimObjectKeys() {
14159
14195
 
14160
14196
  module.exports = keysShim;
14161
14197
 
14162
- },{"./implementation":61,"./isArguments":63}],63:[function(require,module,exports){
14198
+ },{"./implementation":60,"./isArguments":62}],62:[function(require,module,exports){
14163
14199
  'use strict';
14164
14200
 
14165
14201
  var toStr = Object.prototype.toString;
@@ -14178,7 +14214,7 @@ module.exports = function isArguments(value) {
14178
14214
  return isArgs;
14179
14215
  };
14180
14216
 
14181
- },{}],64:[function(require,module,exports){
14217
+ },{}],63:[function(require,module,exports){
14182
14218
  'use strict';
14183
14219
 
14184
14220
  // modified from https://github.com/es-shims/es6-shim
@@ -14221,7 +14257,7 @@ module.exports = function assign(target, source1) {
14221
14257
  return objTarget;
14222
14258
  };
14223
14259
 
14224
- },{"function-bind":52,"has-symbols/shams":53,"object-keys":62}],65:[function(require,module,exports){
14260
+ },{"function-bind":52,"has-symbols/shams":53,"object-keys":61}],64:[function(require,module,exports){
14225
14261
  'use strict';
14226
14262
 
14227
14263
  var defineProperties = require('define-properties');
@@ -14240,7 +14276,7 @@ defineProperties(polyfill, {
14240
14276
 
14241
14277
  module.exports = polyfill;
14242
14278
 
14243
- },{"./implementation":64,"./polyfill":66,"./shim":67,"define-properties":47}],66:[function(require,module,exports){
14279
+ },{"./implementation":63,"./polyfill":65,"./shim":66,"define-properties":47}],65:[function(require,module,exports){
14244
14280
  'use strict';
14245
14281
 
14246
14282
  var implementation = require('./implementation');
@@ -14293,7 +14329,7 @@ module.exports = function getPolyfill() {
14293
14329
  return Object.assign;
14294
14330
  };
14295
14331
 
14296
- },{"./implementation":64}],67:[function(require,module,exports){
14332
+ },{"./implementation":63}],66:[function(require,module,exports){
14297
14333
  'use strict';
14298
14334
 
14299
14335
  var define = require('define-properties');
@@ -14309,11 +14345,12 @@ module.exports = function shimAssign() {
14309
14345
  return polyfill;
14310
14346
  };
14311
14347
 
14312
- },{"./polyfill":66,"define-properties":47}],68:[function(require,module,exports){
14348
+ },{"./polyfill":65,"define-properties":47}],67:[function(require,module,exports){
14313
14349
  (function (process){
14314
14350
  'use strict';
14315
14351
 
14316
- if (!process.version ||
14352
+ if (typeof process === 'undefined' ||
14353
+ !process.version ||
14317
14354
  process.version.indexOf('v0.') === 0 ||
14318
14355
  process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
14319
14356
  module.exports = { nextTick: nextTick };
@@ -14357,7 +14394,7 @@ function nextTick(fn, arg1, arg2, arg3) {
14357
14394
 
14358
14395
 
14359
14396
  }).call(this,require('_process'))
14360
- },{"_process":69}],69:[function(require,module,exports){
14397
+ },{"_process":68}],68:[function(require,module,exports){
14361
14398
  // shim for using process in browser
14362
14399
  var process = module.exports = {};
14363
14400
 
@@ -14543,10 +14580,10 @@ process.chdir = function (dir) {
14543
14580
  };
14544
14581
  process.umask = function() { return 0; };
14545
14582
 
14546
- },{}],70:[function(require,module,exports){
14583
+ },{}],69:[function(require,module,exports){
14547
14584
  module.exports = require('./lib/_stream_duplex.js');
14548
14585
 
14549
- },{"./lib/_stream_duplex.js":71}],71:[function(require,module,exports){
14586
+ },{"./lib/_stream_duplex.js":70}],70:[function(require,module,exports){
14550
14587
  // Copyright Joyent, Inc. and other Node contributors.
14551
14588
  //
14552
14589
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -14592,7 +14629,7 @@ var objectKeys = Object.keys || function (obj) {
14592
14629
  module.exports = Duplex;
14593
14630
 
14594
14631
  /*<replacement>*/
14595
- var util = require('core-util-is');
14632
+ var util = Object.create(require('core-util-is'));
14596
14633
  util.inherits = require('inherits');
14597
14634
  /*</replacement>*/
14598
14635
 
@@ -14678,7 +14715,7 @@ Duplex.prototype._destroy = function (err, cb) {
14678
14715
 
14679
14716
  pna.nextTick(cb, err);
14680
14717
  };
14681
- },{"./_stream_readable":73,"./_stream_writable":75,"core-util-is":44,"inherits":56,"process-nextick-args":68}],72:[function(require,module,exports){
14718
+ },{"./_stream_readable":72,"./_stream_writable":74,"core-util-is":44,"inherits":56,"process-nextick-args":67}],71:[function(require,module,exports){
14682
14719
  // Copyright Joyent, Inc. and other Node contributors.
14683
14720
  //
14684
14721
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -14711,7 +14748,7 @@ module.exports = PassThrough;
14711
14748
  var Transform = require('./_stream_transform');
14712
14749
 
14713
14750
  /*<replacement>*/
14714
- var util = require('core-util-is');
14751
+ var util = Object.create(require('core-util-is'));
14715
14752
  util.inherits = require('inherits');
14716
14753
  /*</replacement>*/
14717
14754
 
@@ -14726,7 +14763,7 @@ function PassThrough(options) {
14726
14763
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
14727
14764
  cb(null, chunk);
14728
14765
  };
14729
- },{"./_stream_transform":74,"core-util-is":44,"inherits":56}],73:[function(require,module,exports){
14766
+ },{"./_stream_transform":73,"core-util-is":44,"inherits":56}],72:[function(require,module,exports){
14730
14767
  (function (process,global){
14731
14768
  // Copyright Joyent, Inc. and other Node contributors.
14732
14769
  //
@@ -14794,7 +14831,7 @@ function _isUint8Array(obj) {
14794
14831
  /*</replacement>*/
14795
14832
 
14796
14833
  /*<replacement>*/
14797
- var util = require('core-util-is');
14834
+ var util = Object.create(require('core-util-is'));
14798
14835
  util.inherits = require('inherits');
14799
14836
  /*</replacement>*/
14800
14837
 
@@ -15748,7 +15785,7 @@ function indexOf(xs, x) {
15748
15785
  return -1;
15749
15786
  }
15750
15787
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15751
- },{"./_stream_duplex":71,"./internal/streams/BufferList":76,"./internal/streams/destroy":77,"./internal/streams/stream":78,"_process":69,"core-util-is":44,"events":50,"inherits":56,"isarray":58,"process-nextick-args":68,"safe-buffer":83,"string_decoder/":85,"util":40}],74:[function(require,module,exports){
15788
+ },{"./_stream_duplex":70,"./internal/streams/BufferList":75,"./internal/streams/destroy":76,"./internal/streams/stream":77,"_process":68,"core-util-is":44,"events":50,"inherits":56,"isarray":78,"process-nextick-args":67,"safe-buffer":83,"string_decoder/":85,"util":40}],73:[function(require,module,exports){
15752
15789
  // Copyright Joyent, Inc. and other Node contributors.
15753
15790
  //
15754
15791
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -15819,7 +15856,7 @@ module.exports = Transform;
15819
15856
  var Duplex = require('./_stream_duplex');
15820
15857
 
15821
15858
  /*<replacement>*/
15822
- var util = require('core-util-is');
15859
+ var util = Object.create(require('core-util-is'));
15823
15860
  util.inherits = require('inherits');
15824
15861
  /*</replacement>*/
15825
15862
 
@@ -15963,7 +16000,7 @@ function done(stream, er, data) {
15963
16000
 
15964
16001
  return stream.push(null);
15965
16002
  }
15966
- },{"./_stream_duplex":71,"core-util-is":44,"inherits":56}],75:[function(require,module,exports){
16003
+ },{"./_stream_duplex":70,"core-util-is":44,"inherits":56}],74:[function(require,module,exports){
15967
16004
  (function (process,global,setImmediate){
15968
16005
  // Copyright Joyent, Inc. and other Node contributors.
15969
16006
  //
@@ -16031,7 +16068,7 @@ var Duplex;
16031
16068
  Writable.WritableState = WritableState;
16032
16069
 
16033
16070
  /*<replacement>*/
16034
- var util = require('core-util-is');
16071
+ var util = Object.create(require('core-util-is'));
16035
16072
  util.inherits = require('inherits');
16036
16073
  /*</replacement>*/
16037
16074
 
@@ -16653,7 +16690,7 @@ Writable.prototype._destroy = function (err, cb) {
16653
16690
  cb(err);
16654
16691
  };
16655
16692
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
16656
- },{"./_stream_duplex":71,"./internal/streams/destroy":77,"./internal/streams/stream":78,"_process":69,"core-util-is":44,"inherits":56,"process-nextick-args":68,"safe-buffer":83,"timers":86,"util-deprecate":87}],76:[function(require,module,exports){
16693
+ },{"./_stream_duplex":70,"./internal/streams/destroy":76,"./internal/streams/stream":77,"_process":68,"core-util-is":44,"inherits":56,"process-nextick-args":67,"safe-buffer":83,"timers":86,"util-deprecate":87}],75:[function(require,module,exports){
16657
16694
  'use strict';
16658
16695
 
16659
16696
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -16733,7 +16770,7 @@ if (util && util.inspect && util.inspect.custom) {
16733
16770
  return this.constructor.name + ' ' + obj;
16734
16771
  };
16735
16772
  }
16736
- },{"safe-buffer":83,"util":40}],77:[function(require,module,exports){
16773
+ },{"safe-buffer":83,"util":40}],76:[function(require,module,exports){
16737
16774
  'use strict';
16738
16775
 
16739
16776
  /*<replacement>*/
@@ -16808,10 +16845,17 @@ module.exports = {
16808
16845
  destroy: destroy,
16809
16846
  undestroy: undestroy
16810
16847
  };
16811
- },{"process-nextick-args":68}],78:[function(require,module,exports){
16848
+ },{"process-nextick-args":67}],77:[function(require,module,exports){
16812
16849
  module.exports = require('events').EventEmitter;
16813
16850
 
16814
- },{"events":50}],79:[function(require,module,exports){
16851
+ },{"events":50}],78:[function(require,module,exports){
16852
+ var toString = {}.toString;
16853
+
16854
+ module.exports = Array.isArray || function (arr) {
16855
+ return toString.call(arr) == '[object Array]';
16856
+ };
16857
+
16858
+ },{}],79:[function(require,module,exports){
16815
16859
  module.exports = require('./readable').PassThrough
16816
16860
 
16817
16861
  },{"./readable":80}],80:[function(require,module,exports){
@@ -16823,13 +16867,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
16823
16867
  exports.Transform = require('./lib/_stream_transform.js');
16824
16868
  exports.PassThrough = require('./lib/_stream_passthrough.js');
16825
16869
 
16826
- },{"./lib/_stream_duplex.js":71,"./lib/_stream_passthrough.js":72,"./lib/_stream_readable.js":73,"./lib/_stream_transform.js":74,"./lib/_stream_writable.js":75}],81:[function(require,module,exports){
16870
+ },{"./lib/_stream_duplex.js":70,"./lib/_stream_passthrough.js":71,"./lib/_stream_readable.js":72,"./lib/_stream_transform.js":73,"./lib/_stream_writable.js":74}],81:[function(require,module,exports){
16827
16871
  module.exports = require('./readable').Transform
16828
16872
 
16829
16873
  },{"./readable":80}],82:[function(require,module,exports){
16830
16874
  module.exports = require('./lib/_stream_writable.js');
16831
16875
 
16832
- },{"./lib/_stream_writable.js":75}],83:[function(require,module,exports){
16876
+ },{"./lib/_stream_writable.js":74}],83:[function(require,module,exports){
16833
16877
  /* eslint-disable node/no-deprecated-api */
16834
16878
  var buffer = require('buffer')
16835
16879
  var Buffer = buffer.Buffer
@@ -17022,7 +17066,7 @@ Stream.prototype.pipe = function(dest, options) {
17022
17066
  return dest;
17023
17067
  };
17024
17068
 
17025
- },{"events":50,"inherits":56,"readable-stream/duplex.js":70,"readable-stream/passthrough.js":79,"readable-stream/readable.js":80,"readable-stream/transform.js":81,"readable-stream/writable.js":82}],85:[function(require,module,exports){
17069
+ },{"events":50,"inherits":56,"readable-stream/duplex.js":69,"readable-stream/passthrough.js":79,"readable-stream/readable.js":80,"readable-stream/transform.js":81,"readable-stream/writable.js":82}],85:[function(require,module,exports){
17026
17070
  // Copyright Joyent, Inc. and other Node contributors.
17027
17071
  //
17028
17072
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -17398,7 +17442,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
17398
17442
  delete immediateIds[id];
17399
17443
  };
17400
17444
  }).call(this,require("timers").setImmediate,require("timers").clearImmediate)
17401
- },{"process/browser.js":69,"timers":86}],87:[function(require,module,exports){
17445
+ },{"process/browser.js":68,"timers":86}],87:[function(require,module,exports){
17402
17446
  (function (global){
17403
17447
 
17404
17448
  /**
@@ -17470,13 +17514,38 @@ function config (name) {
17470
17514
 
17471
17515
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17472
17516
  },{}],88:[function(require,module,exports){
17517
+ if (typeof Object.create === 'function') {
17518
+ // implementation from standard node.js 'util' module
17519
+ module.exports = function inherits(ctor, superCtor) {
17520
+ ctor.super_ = superCtor
17521
+ ctor.prototype = Object.create(superCtor.prototype, {
17522
+ constructor: {
17523
+ value: ctor,
17524
+ enumerable: false,
17525
+ writable: true,
17526
+ configurable: true
17527
+ }
17528
+ });
17529
+ };
17530
+ } else {
17531
+ // old school shim for old browsers
17532
+ module.exports = function inherits(ctor, superCtor) {
17533
+ ctor.super_ = superCtor
17534
+ var TempCtor = function () {}
17535
+ TempCtor.prototype = superCtor.prototype
17536
+ ctor.prototype = new TempCtor()
17537
+ ctor.prototype.constructor = ctor
17538
+ }
17539
+ }
17540
+
17541
+ },{}],89:[function(require,module,exports){
17473
17542
  module.exports = function isBuffer(arg) {
17474
17543
  return arg && typeof arg === 'object'
17475
17544
  && typeof arg.copy === 'function'
17476
17545
  && typeof arg.fill === 'function'
17477
17546
  && typeof arg.readUInt8 === 'function';
17478
17547
  }
17479
- },{}],89:[function(require,module,exports){
17548
+ },{}],90:[function(require,module,exports){
17480
17549
  (function (process,global){
17481
17550
  // Copyright Joyent, Inc. and other Node contributors.
17482
17551
  //
@@ -18066,10 +18135,10 @@ function hasOwnProperty(obj, prop) {
18066
18135
  }
18067
18136
 
18068
18137
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
18069
- },{"./support/isBuffer":88,"_process":69,"inherits":56}],90:[function(require,module,exports){
18138
+ },{"./support/isBuffer":89,"_process":68,"inherits":88}],91:[function(require,module,exports){
18070
18139
  module.exports={
18071
18140
  "name": "mocha",
18072
- "version": "6.1.4",
18141
+ "version": "6.2.3",
18073
18142
  "homepage": "https://mochajs.org/",
18074
18143
  "notifyLogo": "https://ibin.co/4QuRuGjXvl36.png"
18075
18144
  }