mocha 6.2.3 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +102 -1347
- package/LICENSE +1 -1
- package/README.md +6 -6
- package/bin/mocha +12 -41
- package/browser-entry.js +2 -2
- package/lib/cli/config.js +2 -1
- package/lib/cli/node-flags.js +1 -1
- package/lib/cli/one-and-dones.js +2 -2
- package/lib/cli/options.js +4 -35
- package/lib/cli/run-helpers.js +12 -10
- package/lib/cli/run-option-metadata.js +6 -5
- package/lib/cli/run.js +32 -14
- package/lib/cli/watch-run.js +116 -31
- package/lib/esm-utils.js +31 -0
- package/lib/mocha.js +194 -103
- package/lib/mocharc.json +3 -2
- package/lib/reporters/base.js +15 -5
- package/lib/reporters/xunit.js +3 -3
- package/lib/runnable.js +26 -18
- package/lib/runner.js +99 -87
- package/lib/test.js +13 -0
- package/lib/utils.js +22 -74
- package/mocha.js +483 -452
- package/package.json +25 -504
- package/bin/options.js +0 -10
package/mocha.js
CHANGED
|
@@ -62,7 +62,7 @@ process.on = function(e, fn) {
|
|
|
62
62
|
if (e === 'uncaughtException') {
|
|
63
63
|
global.onerror = function(err, url, line) {
|
|
64
64
|
fn(new Error(err + ' (' + url + ':' + line + ')'));
|
|
65
|
-
return !mocha.allowUncaught;
|
|
65
|
+
return !mocha.options.allowUncaught;
|
|
66
66
|
};
|
|
67
67
|
uncaughtExceptionHandlers.push(fn);
|
|
68
68
|
}
|
|
@@ -131,7 +131,7 @@ mocha.setup = function(opts) {
|
|
|
131
131
|
opts = {ui: opts};
|
|
132
132
|
}
|
|
133
133
|
for (var opt in opts) {
|
|
134
|
-
if (
|
|
134
|
+
if (Object.prototype.hasOwnProperty.call(opts, opt)) {
|
|
135
135
|
this[opt](opts[opt]);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -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":
|
|
196
|
+
},{"./lib/mocha":14,"_process":69,"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":
|
|
368
|
+
},{"../../package":90,"../runner":34,"_process":69}],3:[function(require,module,exports){
|
|
369
369
|
'use strict';
|
|
370
370
|
|
|
371
371
|
/**
|
|
@@ -1408,6 +1408,7 @@ var utils = require('./utils');
|
|
|
1408
1408
|
var mocharc = require('./mocharc.json');
|
|
1409
1409
|
var errors = require('./errors');
|
|
1410
1410
|
var Suite = require('./suite');
|
|
1411
|
+
var esmUtils = utils.supportsEsModules() ? require('./esm-utils') : undefined;
|
|
1411
1412
|
var createStatsCollector = require('./stats-collector');
|
|
1412
1413
|
var createInvalidReporterError = errors.createInvalidReporterError;
|
|
1413
1414
|
var createInvalidInterfaceError = errors.createInvalidInterfaceError;
|
|
@@ -1463,18 +1464,18 @@ exports.Test = require('./test');
|
|
|
1463
1464
|
* @param {boolean} [options.allowUncaught] - Propagate uncaught errors?
|
|
1464
1465
|
* @param {boolean} [options.asyncOnly] - Force `done` callback or promise?
|
|
1465
1466
|
* @param {boolean} [options.bail] - Bail after first test failure?
|
|
1466
|
-
* @param {boolean} [options.checkLeaks] -
|
|
1467
|
+
* @param {boolean} [options.checkLeaks] - Check for global variable leaks?
|
|
1468
|
+
* @param {boolean} [options.color] - Color TTY output from reporter?
|
|
1467
1469
|
* @param {boolean} [options.delay] - Delay root suite execution?
|
|
1468
|
-
* @param {boolean} [options.
|
|
1470
|
+
* @param {boolean} [options.diff] - Show diff on failure?
|
|
1469
1471
|
* @param {string} [options.fgrep] - Test filter given string.
|
|
1470
1472
|
* @param {boolean} [options.forbidOnly] - Tests marked `only` fail the suite?
|
|
1471
1473
|
* @param {boolean} [options.forbidPending] - Pending tests fail the suite?
|
|
1472
|
-
* @param {boolean} [options.
|
|
1474
|
+
* @param {boolean} [options.fullTrace] - Full stacktrace upon failure?
|
|
1473
1475
|
* @param {string[]} [options.global] - Variables expected in global scope.
|
|
1474
1476
|
* @param {RegExp|string} [options.grep] - Test filter given regular expression.
|
|
1475
1477
|
* @param {boolean} [options.growl] - Enable desktop notifications?
|
|
1476
|
-
* @param {boolean} [options.
|
|
1477
|
-
* @param {boolean} [options.ignoreLeaks] - Ignore global leaks?
|
|
1478
|
+
* @param {boolean} [options.inlineDiffs] - Display inline diffs?
|
|
1478
1479
|
* @param {boolean} [options.invert] - Invert test filter matches?
|
|
1479
1480
|
* @param {boolean} [options.noHighlighting] - Disable syntax highlighting?
|
|
1480
1481
|
* @param {string|constructor} [options.reporter] - Reporter name or constructor.
|
|
@@ -1483,8 +1484,6 @@ exports.Test = require('./test');
|
|
|
1483
1484
|
* @param {number} [options.slow] - Slow threshold value.
|
|
1484
1485
|
* @param {number|string} [options.timeout] - Timeout threshold value.
|
|
1485
1486
|
* @param {string} [options.ui] - Interface name.
|
|
1486
|
-
* @param {boolean} [options.color] - Color TTY output from reporter?
|
|
1487
|
-
* @param {boolean} [options.useInlineDiffs] - Use inline diffs?
|
|
1488
1487
|
*/
|
|
1489
1488
|
function Mocha(options) {
|
|
1490
1489
|
options = utils.assign({}, mocharc, options || {});
|
|
@@ -1493,35 +1492,15 @@ function Mocha(options) {
|
|
|
1493
1492
|
// root suite
|
|
1494
1493
|
this.suite = new exports.Suite('', new exports.Context(), true);
|
|
1495
1494
|
|
|
1496
|
-
if ('useColors' in options) {
|
|
1497
|
-
utils.deprecate(
|
|
1498
|
-
'useColors is DEPRECATED and will be removed from a future version of Mocha. Instead, use the "color" option'
|
|
1499
|
-
);
|
|
1500
|
-
options.color = 'color' in options ? options.color : options.useColors;
|
|
1501
|
-
}
|
|
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
|
-
|
|
1507
1495
|
this.grep(options.grep)
|
|
1508
1496
|
.fgrep(options.fgrep)
|
|
1509
1497
|
.ui(options.ui)
|
|
1510
|
-
.
|
|
1511
|
-
|
|
1512
|
-
|
|
1498
|
+
.reporter(
|
|
1499
|
+
options.reporter,
|
|
1500
|
+
options.reporterOption || options.reporterOptions // reporterOptions was previously the only way to specify options to reporter
|
|
1501
|
+
)
|
|
1513
1502
|
.slow(options.slow)
|
|
1514
|
-
.
|
|
1515
|
-
.globals(options.globals);
|
|
1516
|
-
|
|
1517
|
-
if ('enableTimeouts' in options) {
|
|
1518
|
-
utils.deprecate(
|
|
1519
|
-
'enableTimeouts is DEPRECATED and will be removed from a future version of Mocha. Instead, use "timeout: false" to disable timeouts.'
|
|
1520
|
-
);
|
|
1521
|
-
if (options.enableTimeouts === false) {
|
|
1522
|
-
this.timeout(0);
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1503
|
+
.global(options.global);
|
|
1525
1504
|
|
|
1526
1505
|
// this guard exists because Suite#timeout does not consider `undefined` to be valid input
|
|
1527
1506
|
if (typeof options.timeout !== 'undefined') {
|
|
@@ -1532,19 +1511,19 @@ function Mocha(options) {
|
|
|
1532
1511
|
this.retries(options.retries);
|
|
1533
1512
|
}
|
|
1534
1513
|
|
|
1535
|
-
if ('diff' in options) {
|
|
1536
|
-
this.hideDiff(!options.diff);
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
1514
|
[
|
|
1540
1515
|
'allowUncaught',
|
|
1541
1516
|
'asyncOnly',
|
|
1517
|
+
'bail',
|
|
1542
1518
|
'checkLeaks',
|
|
1519
|
+
'color',
|
|
1543
1520
|
'delay',
|
|
1521
|
+
'diff',
|
|
1544
1522
|
'forbidOnly',
|
|
1545
1523
|
'forbidPending',
|
|
1546
1524
|
'fullTrace',
|
|
1547
1525
|
'growl',
|
|
1526
|
+
'inlineDiffs',
|
|
1548
1527
|
'invert'
|
|
1549
1528
|
].forEach(function(opt) {
|
|
1550
1529
|
if (options[opt]) {
|
|
@@ -1557,16 +1536,13 @@ function Mocha(options) {
|
|
|
1557
1536
|
* Enables or disables bailing on the first failure.
|
|
1558
1537
|
*
|
|
1559
1538
|
* @public
|
|
1560
|
-
* @see
|
|
1539
|
+
* @see [CLI option](../#-bail-b)
|
|
1561
1540
|
* @param {boolean} [bail=true] - Whether to bail on first error.
|
|
1562
1541
|
* @returns {Mocha} this
|
|
1563
1542
|
* @chainable
|
|
1564
1543
|
*/
|
|
1565
1544
|
Mocha.prototype.bail = function(bail) {
|
|
1566
|
-
|
|
1567
|
-
bail = true;
|
|
1568
|
-
}
|
|
1569
|
-
this.suite.bail(bail);
|
|
1545
|
+
this.suite.bail(bail !== false);
|
|
1570
1546
|
return this;
|
|
1571
1547
|
};
|
|
1572
1548
|
|
|
@@ -1578,7 +1554,7 @@ Mocha.prototype.bail = function(bail) {
|
|
|
1578
1554
|
* Useful for generic setup code that must be included within test suite.
|
|
1579
1555
|
*
|
|
1580
1556
|
* @public
|
|
1581
|
-
* @see
|
|
1557
|
+
* @see [CLI option](../#-file-filedirectoryglob)
|
|
1582
1558
|
* @param {string} file - Pathname of file to be loaded.
|
|
1583
1559
|
* @returns {Mocha} this
|
|
1584
1560
|
* @chainable
|
|
@@ -1592,8 +1568,8 @@ Mocha.prototype.addFile = function(file) {
|
|
|
1592
1568
|
* Sets reporter to `reporter`, defaults to "spec".
|
|
1593
1569
|
*
|
|
1594
1570
|
* @public
|
|
1595
|
-
* @see
|
|
1596
|
-
* @see
|
|
1571
|
+
* @see [CLI option](../#-reporter-name-r-name)
|
|
1572
|
+
* @see [Reporters](../#reporters)
|
|
1597
1573
|
* @param {String|Function} reporter - Reporter name or constructor.
|
|
1598
1574
|
* @param {Object} [reporterOptions] - Options used to configure the reporter.
|
|
1599
1575
|
* @returns {Mocha} this
|
|
@@ -1651,6 +1627,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions) {
|
|
|
1651
1627
|
}
|
|
1652
1628
|
this._reporter = _reporter;
|
|
1653
1629
|
}
|
|
1630
|
+
this.options.reporterOption = reporterOptions;
|
|
1631
|
+
// alias option name is used in public reporters xunit/tap/progress
|
|
1654
1632
|
this.options.reporterOptions = reporterOptions;
|
|
1655
1633
|
return this;
|
|
1656
1634
|
};
|
|
@@ -1659,8 +1637,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions) {
|
|
|
1659
1637
|
* Sets test UI `name`, defaults to "bdd".
|
|
1660
1638
|
*
|
|
1661
1639
|
* @public
|
|
1662
|
-
* @see
|
|
1663
|
-
* @see
|
|
1640
|
+
* @see [CLI option](../#-ui-name-u-name)
|
|
1641
|
+
* @see [Interface DSLs](../#interfaces)
|
|
1664
1642
|
* @param {string|Function} [ui=bdd] - Interface name or class.
|
|
1665
1643
|
* @returns {Mocha} this
|
|
1666
1644
|
* @chainable
|
|
@@ -1707,16 +1685,18 @@ Mocha.prototype.ui = function(ui) {
|
|
|
1707
1685
|
};
|
|
1708
1686
|
|
|
1709
1687
|
/**
|
|
1710
|
-
* Loads `files` prior to execution.
|
|
1688
|
+
* Loads `files` prior to execution. Does not support ES Modules.
|
|
1711
1689
|
*
|
|
1712
1690
|
* @description
|
|
1713
1691
|
* The implementation relies on Node's `require` to execute
|
|
1714
1692
|
* the test interface functions and will be subject to its cache.
|
|
1693
|
+
* Supports only CommonJS modules. To load ES modules, use Mocha#loadFilesAsync.
|
|
1715
1694
|
*
|
|
1716
1695
|
* @private
|
|
1717
1696
|
* @see {@link Mocha#addFile}
|
|
1718
1697
|
* @see {@link Mocha#run}
|
|
1719
1698
|
* @see {@link Mocha#unloadFiles}
|
|
1699
|
+
* @see {@link Mocha#loadFilesAsync}
|
|
1720
1700
|
* @param {Function} [fn] - Callback invoked upon completion.
|
|
1721
1701
|
*/
|
|
1722
1702
|
Mocha.prototype.loadFiles = function(fn) {
|
|
@@ -1731,6 +1711,49 @@ Mocha.prototype.loadFiles = function(fn) {
|
|
|
1731
1711
|
fn && fn();
|
|
1732
1712
|
};
|
|
1733
1713
|
|
|
1714
|
+
/**
|
|
1715
|
+
* Loads `files` prior to execution. Supports Node ES Modules.
|
|
1716
|
+
*
|
|
1717
|
+
* @description
|
|
1718
|
+
* The implementation relies on Node's `require` and `import` to execute
|
|
1719
|
+
* the test interface functions and will be subject to its cache.
|
|
1720
|
+
* Supports both CJS and ESM modules.
|
|
1721
|
+
*
|
|
1722
|
+
* @public
|
|
1723
|
+
* @see {@link Mocha#addFile}
|
|
1724
|
+
* @see {@link Mocha#run}
|
|
1725
|
+
* @see {@link Mocha#unloadFiles}
|
|
1726
|
+
* @returns {Promise}
|
|
1727
|
+
* @example
|
|
1728
|
+
*
|
|
1729
|
+
* // loads ESM (and CJS) test files asynchronously, then runs root suite
|
|
1730
|
+
* mocha.loadFilesAsync()
|
|
1731
|
+
* .then(() => mocha.run(failures => process.exitCode = failures ? 1 : 0))
|
|
1732
|
+
* .catch(() => process.exitCode = 1);
|
|
1733
|
+
*/
|
|
1734
|
+
Mocha.prototype.loadFilesAsync = function() {
|
|
1735
|
+
var self = this;
|
|
1736
|
+
var suite = this.suite;
|
|
1737
|
+
this.loadAsync = true;
|
|
1738
|
+
|
|
1739
|
+
if (!esmUtils) {
|
|
1740
|
+
return new Promise(function(resolve) {
|
|
1741
|
+
self.loadFiles(resolve);
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
return esmUtils.loadFilesAsync(
|
|
1746
|
+
this.files,
|
|
1747
|
+
function(file) {
|
|
1748
|
+
suite.emit(EVENT_FILE_PRE_REQUIRE, global, file, self);
|
|
1749
|
+
},
|
|
1750
|
+
function(file, resultModule) {
|
|
1751
|
+
suite.emit(EVENT_FILE_REQUIRE, resultModule, file, self);
|
|
1752
|
+
suite.emit(EVENT_FILE_POST_REQUIRE, global, file, self);
|
|
1753
|
+
}
|
|
1754
|
+
);
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1734
1757
|
/**
|
|
1735
1758
|
* Removes a previously loaded file from Node's `require` cache.
|
|
1736
1759
|
*
|
|
@@ -1747,14 +1770,13 @@ Mocha.unloadFile = function(file) {
|
|
|
1747
1770
|
* Unloads `files` from Node's `require` cache.
|
|
1748
1771
|
*
|
|
1749
1772
|
* @description
|
|
1750
|
-
* This allows files to be "freshly" reloaded, providing the ability
|
|
1773
|
+
* This allows required files to be "freshly" reloaded, providing the ability
|
|
1751
1774
|
* to reuse a Mocha instance programmatically.
|
|
1775
|
+
* Note: does not clear ESM module files from the cache
|
|
1752
1776
|
*
|
|
1753
1777
|
* <strong>Intended for consumers — not used internally</strong>
|
|
1754
1778
|
*
|
|
1755
1779
|
* @public
|
|
1756
|
-
* @see {@link Mocha.unloadFile}
|
|
1757
|
-
* @see {@link Mocha#loadFiles}
|
|
1758
1780
|
* @see {@link Mocha#run}
|
|
1759
1781
|
* @returns {Mocha} this
|
|
1760
1782
|
* @chainable
|
|
@@ -1798,7 +1820,7 @@ Mocha.prototype.fgrep = function(str) {
|
|
|
1798
1820
|
* <strong>Previous filter value will be overwritten on each call!</strong>
|
|
1799
1821
|
*
|
|
1800
1822
|
* @public
|
|
1801
|
-
* @see
|
|
1823
|
+
* @see [CLI option](../#-grep-regexp-g-regexp)
|
|
1802
1824
|
* @see {@link Mocha#fgrep}
|
|
1803
1825
|
* @see {@link Mocha#invert}
|
|
1804
1826
|
* @param {RegExp|String} re - Regular expression used to select tests.
|
|
@@ -1849,32 +1871,32 @@ Mocha.prototype.invert = function() {
|
|
|
1849
1871
|
/**
|
|
1850
1872
|
* Enables or disables ignoring global leaks.
|
|
1851
1873
|
*
|
|
1874
|
+
* @deprecated since v7.0.0
|
|
1852
1875
|
* @public
|
|
1853
1876
|
* @see {@link Mocha#checkLeaks}
|
|
1854
|
-
* @param {boolean} ignoreLeaks - Whether to ignore global leaks.
|
|
1877
|
+
* @param {boolean} [ignoreLeaks=false] - Whether to ignore global leaks.
|
|
1855
1878
|
* @return {Mocha} this
|
|
1856
1879
|
* @chainable
|
|
1857
|
-
* @example
|
|
1858
|
-
*
|
|
1859
|
-
* // Ignore global leaks
|
|
1860
|
-
* mocha.ignoreLeaks(true);
|
|
1861
1880
|
*/
|
|
1862
1881
|
Mocha.prototype.ignoreLeaks = function(ignoreLeaks) {
|
|
1863
|
-
|
|
1882
|
+
utils.deprecate(
|
|
1883
|
+
'"ignoreLeaks()" is DEPRECATED, please use "checkLeaks()" instead.'
|
|
1884
|
+
);
|
|
1885
|
+
this.options.checkLeaks = !ignoreLeaks;
|
|
1864
1886
|
return this;
|
|
1865
1887
|
};
|
|
1866
1888
|
|
|
1867
1889
|
/**
|
|
1868
|
-
* Enables checking for global variables leaked while running tests.
|
|
1890
|
+
* Enables or disables checking for global variables leaked while running tests.
|
|
1869
1891
|
*
|
|
1870
1892
|
* @public
|
|
1871
|
-
* @see
|
|
1872
|
-
* @
|
|
1893
|
+
* @see [CLI option](../#-check-leaks)
|
|
1894
|
+
* @param {boolean} [checkLeaks=true] - Whether to check for global variable leaks.
|
|
1873
1895
|
* @return {Mocha} this
|
|
1874
1896
|
* @chainable
|
|
1875
1897
|
*/
|
|
1876
|
-
Mocha.prototype.checkLeaks = function() {
|
|
1877
|
-
this.options.
|
|
1898
|
+
Mocha.prototype.checkLeaks = function(checkLeaks) {
|
|
1899
|
+
this.options.checkLeaks = checkLeaks !== false;
|
|
1878
1900
|
return this;
|
|
1879
1901
|
};
|
|
1880
1902
|
|
|
@@ -1882,11 +1904,13 @@ Mocha.prototype.checkLeaks = function() {
|
|
|
1882
1904
|
* Displays full stack trace upon test failure.
|
|
1883
1905
|
*
|
|
1884
1906
|
* @public
|
|
1907
|
+
* @see [CLI option](../#-full-trace)
|
|
1908
|
+
* @param {boolean} [fullTrace=true] - Whether to print full stacktrace upon failure.
|
|
1885
1909
|
* @return {Mocha} this
|
|
1886
1910
|
* @chainable
|
|
1887
1911
|
*/
|
|
1888
|
-
Mocha.prototype.fullTrace = function() {
|
|
1889
|
-
this.options.
|
|
1912
|
+
Mocha.prototype.fullTrace = function(fullTrace) {
|
|
1913
|
+
this.options.fullTrace = fullTrace !== false;
|
|
1890
1914
|
return this;
|
|
1891
1915
|
};
|
|
1892
1916
|
|
|
@@ -1894,8 +1918,7 @@ Mocha.prototype.fullTrace = function() {
|
|
|
1894
1918
|
* Enables desktop notification support if prerequisite software installed.
|
|
1895
1919
|
*
|
|
1896
1920
|
* @public
|
|
1897
|
-
* @see
|
|
1898
|
-
* @see {@link Mocha#_growl}
|
|
1921
|
+
* @see [CLI option](../#-growl-g)
|
|
1899
1922
|
* @return {Mocha} this
|
|
1900
1923
|
* @chainable
|
|
1901
1924
|
*/
|
|
@@ -1938,65 +1961,121 @@ Mocha.prototype._growl = growl.notify;
|
|
|
1938
1961
|
* Specifies whitelist of variable names to be expected in global scope.
|
|
1939
1962
|
*
|
|
1940
1963
|
* @public
|
|
1941
|
-
* @see
|
|
1964
|
+
* @see [CLI option](../#-global-variable-name)
|
|
1942
1965
|
* @see {@link Mocha#checkLeaks}
|
|
1943
|
-
* @param {String[]|String}
|
|
1966
|
+
* @param {String[]|String} global - Accepted global variable name(s).
|
|
1944
1967
|
* @return {Mocha} this
|
|
1945
1968
|
* @chainable
|
|
1946
1969
|
* @example
|
|
1947
1970
|
*
|
|
1948
1971
|
* // Specify variables to be expected in global scope
|
|
1949
|
-
* mocha.
|
|
1972
|
+
* mocha.global(['jQuery', 'MyLib']);
|
|
1950
1973
|
*/
|
|
1951
|
-
Mocha.prototype.
|
|
1952
|
-
this.options.
|
|
1953
|
-
.concat(
|
|
1974
|
+
Mocha.prototype.global = function(global) {
|
|
1975
|
+
this.options.global = (this.options.global || [])
|
|
1976
|
+
.concat(global)
|
|
1954
1977
|
.filter(Boolean)
|
|
1955
1978
|
.filter(function(elt, idx, arr) {
|
|
1956
1979
|
return arr.indexOf(elt) === idx;
|
|
1957
1980
|
});
|
|
1958
1981
|
return this;
|
|
1959
1982
|
};
|
|
1983
|
+
// for backwards compability, 'globals' is an alias of 'global'
|
|
1984
|
+
Mocha.prototype.globals = Mocha.prototype.global;
|
|
1960
1985
|
|
|
1961
1986
|
/**
|
|
1962
1987
|
* Enables or disables TTY color output by screen-oriented reporters.
|
|
1963
1988
|
*
|
|
1989
|
+
* @deprecated since v7.0.0
|
|
1964
1990
|
* @public
|
|
1991
|
+
* @see {@link Mocha#color}
|
|
1965
1992
|
* @param {boolean} colors - Whether to enable color output.
|
|
1966
1993
|
* @return {Mocha} this
|
|
1967
1994
|
* @chainable
|
|
1968
1995
|
*/
|
|
1969
1996
|
Mocha.prototype.useColors = function(colors) {
|
|
1997
|
+
utils.deprecate('"useColors()" is DEPRECATED, please use "color()" instead.');
|
|
1970
1998
|
if (colors !== undefined) {
|
|
1971
|
-
this.options.
|
|
1999
|
+
this.options.color = colors;
|
|
1972
2000
|
}
|
|
1973
2001
|
return this;
|
|
1974
2002
|
};
|
|
1975
2003
|
|
|
2004
|
+
/**
|
|
2005
|
+
* Enables or disables TTY color output by screen-oriented reporters.
|
|
2006
|
+
*
|
|
2007
|
+
* @public
|
|
2008
|
+
* @see [CLI option](../#-color-c-colors)
|
|
2009
|
+
* @param {boolean} [color=true] - Whether to enable color output.
|
|
2010
|
+
* @return {Mocha} this
|
|
2011
|
+
* @chainable
|
|
2012
|
+
*/
|
|
2013
|
+
Mocha.prototype.color = function(color) {
|
|
2014
|
+
this.options.color = color !== false;
|
|
2015
|
+
return this;
|
|
2016
|
+
};
|
|
2017
|
+
|
|
1976
2018
|
/**
|
|
1977
2019
|
* Determines if reporter should use inline diffs (rather than +/-)
|
|
1978
2020
|
* in test failure output.
|
|
1979
2021
|
*
|
|
2022
|
+
* @deprecated since v7.0.0
|
|
1980
2023
|
* @public
|
|
1981
|
-
* @
|
|
2024
|
+
* @see {@link Mocha#inlineDiffs}
|
|
2025
|
+
* @param {boolean} [inlineDiffs=false] - Whether to use inline diffs.
|
|
1982
2026
|
* @return {Mocha} this
|
|
1983
2027
|
* @chainable
|
|
1984
2028
|
*/
|
|
1985
2029
|
Mocha.prototype.useInlineDiffs = function(inlineDiffs) {
|
|
1986
|
-
|
|
2030
|
+
utils.deprecate(
|
|
2031
|
+
'"useInlineDiffs()" is DEPRECATED, please use "inlineDiffs()" instead.'
|
|
2032
|
+
);
|
|
2033
|
+
this.options.inlineDiffs = inlineDiffs !== undefined && inlineDiffs;
|
|
2034
|
+
return this;
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* Enables or disables reporter to use inline diffs (rather than +/-)
|
|
2039
|
+
* in test failure output.
|
|
2040
|
+
*
|
|
2041
|
+
* @public
|
|
2042
|
+
* @see [CLI option](../#-inline-diffs)
|
|
2043
|
+
* @param {boolean} [inlineDiffs=true] - Whether to use inline diffs.
|
|
2044
|
+
* @return {Mocha} this
|
|
2045
|
+
* @chainable
|
|
2046
|
+
*/
|
|
2047
|
+
Mocha.prototype.inlineDiffs = function(inlineDiffs) {
|
|
2048
|
+
this.options.inlineDiffs = inlineDiffs !== false;
|
|
1987
2049
|
return this;
|
|
1988
2050
|
};
|
|
1989
2051
|
|
|
1990
2052
|
/**
|
|
1991
2053
|
* Determines if reporter should include diffs in test failure output.
|
|
1992
2054
|
*
|
|
2055
|
+
* @deprecated since v7.0.0
|
|
1993
2056
|
* @public
|
|
1994
|
-
* @
|
|
2057
|
+
* @see {@link Mocha#diff}
|
|
2058
|
+
* @param {boolean} [hideDiff=false] - Whether to hide diffs.
|
|
1995
2059
|
* @return {Mocha} this
|
|
1996
2060
|
* @chainable
|
|
1997
2061
|
*/
|
|
1998
2062
|
Mocha.prototype.hideDiff = function(hideDiff) {
|
|
1999
|
-
|
|
2063
|
+
utils.deprecate('"hideDiff()" is DEPRECATED, please use "diff()" instead.');
|
|
2064
|
+
this.options.diff = !(hideDiff === true);
|
|
2065
|
+
return this;
|
|
2066
|
+
};
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Enables or disables reporter to include diff in test failure output.
|
|
2070
|
+
*
|
|
2071
|
+
* @public
|
|
2072
|
+
* @see [CLI option](../#-diff)
|
|
2073
|
+
* @param {boolean} [diff=true] - Whether to show diff on failure.
|
|
2074
|
+
* @return {Mocha} this
|
|
2075
|
+
* @chainable
|
|
2076
|
+
*/
|
|
2077
|
+
Mocha.prototype.diff = function(diff) {
|
|
2078
|
+
this.options.diff = diff !== false;
|
|
2000
2079
|
return this;
|
|
2001
2080
|
};
|
|
2002
2081
|
|
|
@@ -2009,8 +2088,8 @@ Mocha.prototype.hideDiff = function(hideDiff) {
|
|
|
2009
2088
|
* If the value is `0`, timeouts will be disabled.
|
|
2010
2089
|
*
|
|
2011
2090
|
* @public
|
|
2012
|
-
* @see
|
|
2013
|
-
* @see
|
|
2091
|
+
* @see [CLI option](../#-timeout-ms-t-ms)
|
|
2092
|
+
* @see [Timeouts](../#timeouts)
|
|
2014
2093
|
* @see {@link Mocha#enableTimeouts}
|
|
2015
2094
|
* @param {number|string} msecs - Timeout threshold value.
|
|
2016
2095
|
* @return {Mocha} this
|
|
@@ -2033,7 +2112,8 @@ Mocha.prototype.timeout = function(msecs) {
|
|
|
2033
2112
|
* Sets the number of times to retry failed tests.
|
|
2034
2113
|
*
|
|
2035
2114
|
* @public
|
|
2036
|
-
* @see
|
|
2115
|
+
* @see [CLI option](../#-retries-n)
|
|
2116
|
+
* @see [Retry Tests](../#retry-tests)
|
|
2037
2117
|
* @param {number} retry - Number of times to retry failed tests.
|
|
2038
2118
|
* @return {Mocha} this
|
|
2039
2119
|
* @chainable
|
|
@@ -2051,7 +2131,7 @@ Mocha.prototype.retries = function(n) {
|
|
|
2051
2131
|
* Sets slowness threshold value.
|
|
2052
2132
|
*
|
|
2053
2133
|
* @public
|
|
2054
|
-
* @see
|
|
2134
|
+
* @see [CLI option](../#-slow-ms-s-ms)
|
|
2055
2135
|
* @param {number} msecs - Slowness threshold value.
|
|
2056
2136
|
* @return {Mocha} this
|
|
2057
2137
|
* @chainable
|
|
@@ -2073,7 +2153,7 @@ Mocha.prototype.slow = function(msecs) {
|
|
|
2073
2153
|
* Enables or disables timeouts.
|
|
2074
2154
|
*
|
|
2075
2155
|
* @public
|
|
2076
|
-
* @see
|
|
2156
|
+
* @see [CLI option](../#-timeout-ms-t-ms)
|
|
2077
2157
|
* @param {boolean} enableTimeouts - Whether to enable timeouts.
|
|
2078
2158
|
* @return {Mocha} this
|
|
2079
2159
|
* @chainable
|
|
@@ -2089,11 +2169,13 @@ Mocha.prototype.enableTimeouts = function(enableTimeouts) {
|
|
|
2089
2169
|
* Forces all tests to either accept a `done` callback or return a promise.
|
|
2090
2170
|
*
|
|
2091
2171
|
* @public
|
|
2172
|
+
* @see [CLI option](../#-async-only-a)
|
|
2173
|
+
* @param {boolean} [asyncOnly=true] - Wether to force `done` callback or promise.
|
|
2092
2174
|
* @return {Mocha} this
|
|
2093
2175
|
* @chainable
|
|
2094
2176
|
*/
|
|
2095
|
-
Mocha.prototype.asyncOnly = function() {
|
|
2096
|
-
this.options.asyncOnly =
|
|
2177
|
+
Mocha.prototype.asyncOnly = function(asyncOnly) {
|
|
2178
|
+
this.options.asyncOnly = asyncOnly !== false;
|
|
2097
2179
|
return this;
|
|
2098
2180
|
};
|
|
2099
2181
|
|
|
@@ -2110,14 +2192,16 @@ Mocha.prototype.noHighlighting = function() {
|
|
|
2110
2192
|
};
|
|
2111
2193
|
|
|
2112
2194
|
/**
|
|
2113
|
-
* Enables uncaught errors to propagate
|
|
2195
|
+
* Enables or disables uncaught errors to propagate.
|
|
2114
2196
|
*
|
|
2115
2197
|
* @public
|
|
2198
|
+
* @see [CLI option](../#-allow-uncaught)
|
|
2199
|
+
* @param {boolean} [allowUncaught=true] - Whether to propagate uncaught errors.
|
|
2116
2200
|
* @return {Mocha} this
|
|
2117
2201
|
* @chainable
|
|
2118
2202
|
*/
|
|
2119
|
-
Mocha.prototype.allowUncaught = function() {
|
|
2120
|
-
this.options.allowUncaught =
|
|
2203
|
+
Mocha.prototype.allowUncaught = function(allowUncaught) {
|
|
2204
|
+
this.options.allowUncaught = allowUncaught !== false;
|
|
2121
2205
|
return this;
|
|
2122
2206
|
};
|
|
2123
2207
|
|
|
@@ -2129,7 +2213,7 @@ Mocha.prototype.allowUncaught = function() {
|
|
|
2129
2213
|
* Used to perform asynch operations before any suites are run.
|
|
2130
2214
|
*
|
|
2131
2215
|
* @public
|
|
2132
|
-
* @see
|
|
2216
|
+
* @see [delayed root suite](../#delayed-root-suite)
|
|
2133
2217
|
* @returns {Mocha} this
|
|
2134
2218
|
* @chainable
|
|
2135
2219
|
*/
|
|
@@ -2142,11 +2226,13 @@ Mocha.prototype.delay = function delay() {
|
|
|
2142
2226
|
* Causes tests marked `only` to fail the suite.
|
|
2143
2227
|
*
|
|
2144
2228
|
* @public
|
|
2229
|
+
* @see [CLI option](../#-forbid-only)
|
|
2230
|
+
* @param {boolean} [forbidOnly=true] - Whether tests marked `only` fail the suite.
|
|
2145
2231
|
* @returns {Mocha} this
|
|
2146
2232
|
* @chainable
|
|
2147
2233
|
*/
|
|
2148
|
-
Mocha.prototype.forbidOnly = function() {
|
|
2149
|
-
this.options.forbidOnly =
|
|
2234
|
+
Mocha.prototype.forbidOnly = function(forbidOnly) {
|
|
2235
|
+
this.options.forbidOnly = forbidOnly !== false;
|
|
2150
2236
|
return this;
|
|
2151
2237
|
};
|
|
2152
2238
|
|
|
@@ -2154,11 +2240,13 @@ Mocha.prototype.forbidOnly = function() {
|
|
|
2154
2240
|
* Causes pending tests and tests marked `skip` to fail the suite.
|
|
2155
2241
|
*
|
|
2156
2242
|
* @public
|
|
2243
|
+
* @see [CLI option](../#-forbid-pending)
|
|
2244
|
+
* @param {boolean} [forbidPending=true] - Whether pending tests fail the suite.
|
|
2157
2245
|
* @returns {Mocha} this
|
|
2158
2246
|
* @chainable
|
|
2159
2247
|
*/
|
|
2160
|
-
Mocha.prototype.forbidPending = function() {
|
|
2161
|
-
this.options.forbidPending =
|
|
2248
|
+
Mocha.prototype.forbidPending = function(forbidPending) {
|
|
2249
|
+
this.options.forbidPending = forbidPending !== false;
|
|
2162
2250
|
return this;
|
|
2163
2251
|
};
|
|
2164
2252
|
|
|
@@ -2192,14 +2280,17 @@ Object.defineProperty(Mocha.prototype, 'version', {
|
|
|
2192
2280
|
* the cache first!
|
|
2193
2281
|
*
|
|
2194
2282
|
* @public
|
|
2195
|
-
* @see {@link Mocha#loadFiles}
|
|
2196
2283
|
* @see {@link Mocha#unloadFiles}
|
|
2197
2284
|
* @see {@link Runner#run}
|
|
2198
2285
|
* @param {DoneCB} [fn] - Callback invoked when test execution completed.
|
|
2199
|
-
* @
|
|
2286
|
+
* @returns {Runner} runner instance
|
|
2287
|
+
* @example
|
|
2288
|
+
*
|
|
2289
|
+
* // exit with non-zero status if there were test failures
|
|
2290
|
+
* mocha.run(failures => process.exitCode = failures ? 1 : 0);
|
|
2200
2291
|
*/
|
|
2201
2292
|
Mocha.prototype.run = function(fn) {
|
|
2202
|
-
if (this.files.length) {
|
|
2293
|
+
if (this.files.length && !this.loadAsync) {
|
|
2203
2294
|
this.loadFiles();
|
|
2204
2295
|
}
|
|
2205
2296
|
var suite = this.suite;
|
|
@@ -2208,8 +2299,8 @@ Mocha.prototype.run = function(fn) {
|
|
|
2208
2299
|
var runner = new exports.Runner(suite, options.delay);
|
|
2209
2300
|
createStatsCollector(runner);
|
|
2210
2301
|
var reporter = new this._reporter(runner, options);
|
|
2211
|
-
runner.
|
|
2212
|
-
runner.fullStackTrace = options.
|
|
2302
|
+
runner.checkLeaks = options.checkLeaks === true;
|
|
2303
|
+
runner.fullStackTrace = options.fullTrace;
|
|
2213
2304
|
runner.asyncOnly = options.asyncOnly;
|
|
2214
2305
|
runner.allowUncaught = options.allowUncaught;
|
|
2215
2306
|
runner.forbidOnly = options.forbidOnly;
|
|
@@ -2217,17 +2308,17 @@ Mocha.prototype.run = function(fn) {
|
|
|
2217
2308
|
if (options.grep) {
|
|
2218
2309
|
runner.grep(options.grep, options.invert);
|
|
2219
2310
|
}
|
|
2220
|
-
if (options.
|
|
2221
|
-
runner.globals(options.
|
|
2311
|
+
if (options.global) {
|
|
2312
|
+
runner.globals(options.global);
|
|
2222
2313
|
}
|
|
2223
2314
|
if (options.growl) {
|
|
2224
2315
|
this._growl(runner);
|
|
2225
2316
|
}
|
|
2226
|
-
if (options.
|
|
2227
|
-
exports.reporters.Base.useColors = options.
|
|
2317
|
+
if (options.color !== undefined) {
|
|
2318
|
+
exports.reporters.Base.useColors = options.color;
|
|
2228
2319
|
}
|
|
2229
|
-
exports.reporters.Base.inlineDiffs = options.
|
|
2230
|
-
exports.reporters.Base.hideDiff = options.
|
|
2320
|
+
exports.reporters.Base.inlineDiffs = options.inlineDiffs;
|
|
2321
|
+
exports.reporters.Base.hideDiff = !options.diff;
|
|
2231
2322
|
|
|
2232
2323
|
function done(failures) {
|
|
2233
2324
|
fn = fn || utils.noop;
|
|
@@ -2242,16 +2333,17 @@ Mocha.prototype.run = function(fn) {
|
|
|
2242
2333
|
};
|
|
2243
2334
|
|
|
2244
2335
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
2245
|
-
},{"../package.json":
|
|
2336
|
+
},{"../package.json":90,"./context":5,"./errors":6,"./esm-utils":42,"./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){
|
|
2246
2337
|
module.exports={
|
|
2247
2338
|
"diff": true,
|
|
2248
|
-
"extension": ["js"],
|
|
2339
|
+
"extension": ["js", "cjs", "mjs"],
|
|
2249
2340
|
"opts": "./test/mocha.opts",
|
|
2250
2341
|
"package": "./package.json",
|
|
2251
2342
|
"reporter": "spec",
|
|
2252
2343
|
"slow": 75,
|
|
2253
2344
|
"timeout": 2000,
|
|
2254
|
-
"ui": "bdd"
|
|
2345
|
+
"ui": "bdd",
|
|
2346
|
+
"watch-ignore": ["node_modules", ".git"]
|
|
2255
2347
|
}
|
|
2256
2348
|
|
|
2257
2349
|
},{}],16:[function(require,module,exports){
|
|
@@ -2426,14 +2518,14 @@ exports.cursor = {
|
|
|
2426
2518
|
}
|
|
2427
2519
|
};
|
|
2428
2520
|
|
|
2429
|
-
|
|
2521
|
+
var showDiff = (exports.showDiff = function(err) {
|
|
2430
2522
|
return (
|
|
2431
2523
|
err &&
|
|
2432
2524
|
err.showDiff !== false &&
|
|
2433
2525
|
sameType(err.actual, err.expected) &&
|
|
2434
2526
|
err.expected !== undefined
|
|
2435
2527
|
);
|
|
2436
|
-
}
|
|
2528
|
+
});
|
|
2437
2529
|
|
|
2438
2530
|
function stringifyDiffObjs(err) {
|
|
2439
2531
|
if (!utils.isString(err.actual) || !utils.isString(err.expected)) {
|
|
@@ -2454,9 +2546,19 @@ function stringifyDiffObjs(err) {
|
|
|
2454
2546
|
* @return {string} Diff
|
|
2455
2547
|
*/
|
|
2456
2548
|
var generateDiff = (exports.generateDiff = function(actual, expected) {
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2549
|
+
try {
|
|
2550
|
+
return exports.inlineDiffs
|
|
2551
|
+
? inlineDiff(actual, expected)
|
|
2552
|
+
: unifiedDiff(actual, expected);
|
|
2553
|
+
} catch (err) {
|
|
2554
|
+
var msg =
|
|
2555
|
+
'\n ' +
|
|
2556
|
+
color('diff added', '+ expected') +
|
|
2557
|
+
' ' +
|
|
2558
|
+
color('diff removed', '- actual: failed to generate Mocha diff') +
|
|
2559
|
+
'\n';
|
|
2560
|
+
return msg;
|
|
2561
|
+
}
|
|
2460
2562
|
});
|
|
2461
2563
|
|
|
2462
2564
|
/**
|
|
@@ -2785,7 +2887,7 @@ Base.consoleLog = consoleLog;
|
|
|
2785
2887
|
Base.abstract = true;
|
|
2786
2888
|
|
|
2787
2889
|
}).call(this,require('_process'))
|
|
2788
|
-
},{"../runner":34,"../utils":38,"_process":
|
|
2890
|
+
},{"../runner":34,"../utils":38,"_process":69,"diff":48,"ms":60,"supports-color":42,"tty":4}],18:[function(require,module,exports){
|
|
2789
2891
|
'use strict';
|
|
2790
2892
|
/**
|
|
2791
2893
|
* @module Doc
|
|
@@ -2961,7 +3063,7 @@ inherits(Dot, Base);
|
|
|
2961
3063
|
Dot.description = 'dot matrix representation';
|
|
2962
3064
|
|
|
2963
3065
|
}).call(this,require('_process'))
|
|
2964
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
3066
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69}],20:[function(require,module,exports){
|
|
2965
3067
|
(function (global){
|
|
2966
3068
|
'use strict';
|
|
2967
3069
|
|
|
@@ -3470,7 +3572,7 @@ function clean(test) {
|
|
|
3470
3572
|
JSONStream.description = 'newline delimited JSON events';
|
|
3471
3573
|
|
|
3472
3574
|
}).call(this,require('_process'))
|
|
3473
|
-
},{"../runner":34,"./base":17,"_process":
|
|
3575
|
+
},{"../runner":34,"./base":17,"_process":69}],23:[function(require,module,exports){
|
|
3474
3576
|
(function (process){
|
|
3475
3577
|
'use strict';
|
|
3476
3578
|
/**
|
|
@@ -3609,7 +3711,7 @@ function errorJSON(err) {
|
|
|
3609
3711
|
JSONReporter.description = 'single JSON object';
|
|
3610
3712
|
|
|
3611
3713
|
}).call(this,require('_process'))
|
|
3612
|
-
},{"../runner":34,"./base":17,"_process":
|
|
3714
|
+
},{"../runner":34,"./base":17,"_process":69}],24:[function(require,module,exports){
|
|
3613
3715
|
(function (process){
|
|
3614
3716
|
'use strict';
|
|
3615
3717
|
/**
|
|
@@ -3721,7 +3823,7 @@ inherits(Landing, Base);
|
|
|
3721
3823
|
Landing.description = 'Unicode landing strip';
|
|
3722
3824
|
|
|
3723
3825
|
}).call(this,require('_process'))
|
|
3724
|
-
},{"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":
|
|
3826
|
+
},{"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":69}],25:[function(require,module,exports){
|
|
3725
3827
|
(function (process){
|
|
3726
3828
|
'use strict';
|
|
3727
3829
|
/**
|
|
@@ -3803,7 +3905,7 @@ inherits(List, Base);
|
|
|
3803
3905
|
List.description = 'like "spec" reporter but flat';
|
|
3804
3906
|
|
|
3805
3907
|
}).call(this,require('_process'))
|
|
3806
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
3908
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69}],26:[function(require,module,exports){
|
|
3807
3909
|
(function (process){
|
|
3808
3910
|
'use strict';
|
|
3809
3911
|
/**
|
|
@@ -3919,7 +4021,7 @@ function Markdown(runner, options) {
|
|
|
3919
4021
|
Markdown.description = 'GitHub Flavored Markdown';
|
|
3920
4022
|
|
|
3921
4023
|
}).call(this,require('_process'))
|
|
3922
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
4024
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69}],27:[function(require,module,exports){
|
|
3923
4025
|
(function (process){
|
|
3924
4026
|
'use strict';
|
|
3925
4027
|
/**
|
|
@@ -3975,7 +4077,7 @@ inherits(Min, Base);
|
|
|
3975
4077
|
Min.description = 'essentially just a summary';
|
|
3976
4078
|
|
|
3977
4079
|
}).call(this,require('_process'))
|
|
3978
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
4080
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69}],28:[function(require,module,exports){
|
|
3979
4081
|
(function (process){
|
|
3980
4082
|
'use strict';
|
|
3981
4083
|
/**
|
|
@@ -4255,7 +4357,7 @@ function write(string) {
|
|
|
4255
4357
|
NyanCat.description = '"nyan cat"';
|
|
4256
4358
|
|
|
4257
4359
|
}).call(this,require('_process'))
|
|
4258
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
4360
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69}],29:[function(require,module,exports){
|
|
4259
4361
|
(function (process){
|
|
4260
4362
|
'use strict';
|
|
4261
4363
|
/**
|
|
@@ -4363,7 +4465,7 @@ inherits(Progress, Base);
|
|
|
4363
4465
|
Progress.description = 'a progress bar';
|
|
4364
4466
|
|
|
4365
4467
|
}).call(this,require('_process'))
|
|
4366
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
4468
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69}],30:[function(require,module,exports){
|
|
4367
4469
|
'use strict';
|
|
4368
4470
|
/**
|
|
4369
4471
|
* @module Spec
|
|
@@ -4762,7 +4864,7 @@ inherits(TAP13Producer, TAPProducer);
|
|
|
4762
4864
|
TAP.description = 'TAP-compatible output';
|
|
4763
4865
|
|
|
4764
4866
|
}).call(this,require('_process'))
|
|
4765
|
-
},{"../runner":34,"../utils":38,"./base":17,"_process":
|
|
4867
|
+
},{"../runner":34,"../utils":38,"./base":17,"_process":69,"util":89}],32:[function(require,module,exports){
|
|
4766
4868
|
(function (process,global){
|
|
4767
4869
|
'use strict';
|
|
4768
4870
|
/**
|
|
@@ -4929,9 +5031,9 @@ XUnit.prototype.test = function(test) {
|
|
|
4929
5031
|
if (test.state === STATE_FAILED) {
|
|
4930
5032
|
var err = test.err;
|
|
4931
5033
|
var diff =
|
|
4932
|
-
Base.hideDiff
|
|
4933
|
-
? ''
|
|
4934
|
-
: '
|
|
5034
|
+
!Base.hideDiff && Base.showDiff(err)
|
|
5035
|
+
? '\n' + Base.generateDiff(err.actual, err.expected)
|
|
5036
|
+
: '';
|
|
4935
5037
|
this.write(
|
|
4936
5038
|
tag(
|
|
4937
5039
|
'testcase',
|
|
@@ -4982,7 +5084,7 @@ function tag(name, attrs, close, content) {
|
|
|
4982
5084
|
XUnit.description = 'XUnit-compatible XML output';
|
|
4983
5085
|
|
|
4984
5086
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
4985
|
-
},{"../errors":6,"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":
|
|
5087
|
+
},{"../errors":6,"../runnable":33,"../runner":34,"../utils":38,"./base":17,"_process":69,"fs":42,"mkdirp":59,"path":42}],33:[function(require,module,exports){
|
|
4986
5088
|
(function (global){
|
|
4987
5089
|
'use strict';
|
|
4988
5090
|
|
|
@@ -5121,7 +5223,8 @@ Runnable.prototype.enableTimeouts = function(enabled) {
|
|
|
5121
5223
|
* @public
|
|
5122
5224
|
*/
|
|
5123
5225
|
Runnable.prototype.skip = function() {
|
|
5124
|
-
|
|
5226
|
+
this.pending = true;
|
|
5227
|
+
throw new Pending('sync skip; aborting execution');
|
|
5125
5228
|
};
|
|
5126
5229
|
|
|
5127
5230
|
/**
|
|
@@ -5320,43 +5423,45 @@ Runnable.prototype.run = function(fn) {
|
|
|
5320
5423
|
fn(err);
|
|
5321
5424
|
}
|
|
5322
5425
|
|
|
5323
|
-
// for .resetTimeout()
|
|
5426
|
+
// for .resetTimeout() and Runner#uncaught()
|
|
5324
5427
|
this.callback = done;
|
|
5325
5428
|
|
|
5429
|
+
if (this.fn && typeof this.fn.call !== 'function') {
|
|
5430
|
+
done(
|
|
5431
|
+
new TypeError(
|
|
5432
|
+
'A runnable must be passed a function as its second argument.'
|
|
5433
|
+
)
|
|
5434
|
+
);
|
|
5435
|
+
return;
|
|
5436
|
+
}
|
|
5437
|
+
|
|
5326
5438
|
// explicit async with `done` argument
|
|
5327
5439
|
if (this.async) {
|
|
5328
5440
|
this.resetTimeout();
|
|
5329
5441
|
|
|
5330
5442
|
// allows skip() to be used in an explicit async context
|
|
5331
5443
|
this.skip = function asyncSkip() {
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
//
|
|
5335
|
-
// the failure.
|
|
5444
|
+
this.pending = true;
|
|
5445
|
+
done();
|
|
5446
|
+
// halt execution, the uncaught handler will ignore the failure.
|
|
5336
5447
|
throw new Pending('async skip; aborting execution');
|
|
5337
5448
|
};
|
|
5338
5449
|
|
|
5339
|
-
if (this.allowUncaught) {
|
|
5340
|
-
return callFnAsync(this.fn);
|
|
5341
|
-
}
|
|
5342
5450
|
try {
|
|
5343
5451
|
callFnAsync(this.fn);
|
|
5344
5452
|
} catch (err) {
|
|
5453
|
+
// handles async runnables which actually run synchronously
|
|
5345
5454
|
emitted = true;
|
|
5455
|
+
if (err instanceof Pending) {
|
|
5456
|
+
return; // done() is already called in this.skip()
|
|
5457
|
+
} else if (this.allowUncaught) {
|
|
5458
|
+
throw err;
|
|
5459
|
+
}
|
|
5346
5460
|
done(Runnable.toValueOrError(err));
|
|
5347
5461
|
}
|
|
5348
5462
|
return;
|
|
5349
5463
|
}
|
|
5350
5464
|
|
|
5351
|
-
if (this.allowUncaught) {
|
|
5352
|
-
if (this.isPending()) {
|
|
5353
|
-
done();
|
|
5354
|
-
} else {
|
|
5355
|
-
callFn(this.fn);
|
|
5356
|
-
}
|
|
5357
|
-
return;
|
|
5358
|
-
}
|
|
5359
|
-
|
|
5360
5465
|
// sync or promise-returning
|
|
5361
5466
|
try {
|
|
5362
5467
|
if (this.isPending()) {
|
|
@@ -5366,6 +5471,11 @@ Runnable.prototype.run = function(fn) {
|
|
|
5366
5471
|
}
|
|
5367
5472
|
} catch (err) {
|
|
5368
5473
|
emitted = true;
|
|
5474
|
+
if (err instanceof Pending) {
|
|
5475
|
+
return done();
|
|
5476
|
+
} else if (this.allowUncaught) {
|
|
5477
|
+
throw err;
|
|
5478
|
+
}
|
|
5369
5479
|
done(Runnable.toValueOrError(err));
|
|
5370
5480
|
}
|
|
5371
5481
|
|
|
@@ -5482,7 +5592,7 @@ Runnable.toValueOrError = function(value) {
|
|
|
5482
5592
|
Runnable.constants = constants;
|
|
5483
5593
|
|
|
5484
5594
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
5485
|
-
},{"./errors":6,"./pending":16,"./utils":38,"debug":45,"events":50,"ms":
|
|
5595
|
+
},{"./errors":6,"./pending":16,"./utils":38,"debug":45,"events":50,"ms":60}],34:[function(require,module,exports){
|
|
5486
5596
|
(function (process,global){
|
|
5487
5597
|
'use strict';
|
|
5488
5598
|
|
|
@@ -5510,8 +5620,9 @@ var sQuote = utils.sQuote;
|
|
|
5510
5620
|
var stackFilter = utils.stackTraceFilter();
|
|
5511
5621
|
var stringify = utils.stringify;
|
|
5512
5622
|
var type = utils.type;
|
|
5513
|
-
var
|
|
5514
|
-
|
|
5623
|
+
var errors = require('./errors');
|
|
5624
|
+
var createInvalidExceptionError = errors.createInvalidExceptionError;
|
|
5625
|
+
var createUnsupportedError = errors.createUnsupportedError;
|
|
5515
5626
|
|
|
5516
5627
|
/**
|
|
5517
5628
|
* Non-enumerable globals.
|
|
@@ -5620,6 +5731,11 @@ function Runner(suite, delay) {
|
|
|
5620
5731
|
this.total = suite.total();
|
|
5621
5732
|
this.failures = 0;
|
|
5622
5733
|
this.on(constants.EVENT_TEST_END, function(test) {
|
|
5734
|
+
if (test.retriedTest() && test.parent) {
|
|
5735
|
+
var idx =
|
|
5736
|
+
test.parent.tests && test.parent.tests.indexOf(test.retriedTest());
|
|
5737
|
+
if (idx > -1) test.parent.tests[idx] = test;
|
|
5738
|
+
}
|
|
5623
5739
|
self.checkGlobals(test);
|
|
5624
5740
|
});
|
|
5625
5741
|
this.on(constants.EVENT_HOOK_END, function(hook) {
|
|
@@ -5730,7 +5846,7 @@ Runner.prototype.globals = function(arr) {
|
|
|
5730
5846
|
* @private
|
|
5731
5847
|
*/
|
|
5732
5848
|
Runner.prototype.checkGlobals = function(test) {
|
|
5733
|
-
if (this.
|
|
5849
|
+
if (!this.checkLeaks) {
|
|
5734
5850
|
return;
|
|
5735
5851
|
}
|
|
5736
5852
|
var ok = this._globals;
|
|
@@ -5801,8 +5917,7 @@ Runner.prototype.fail = function(test, err) {
|
|
|
5801
5917
|
* - Failed `before each` hook skips remaining tests in a
|
|
5802
5918
|
* suite and jumps to corresponding `after each` hook,
|
|
5803
5919
|
* which is run only once
|
|
5804
|
-
* - Failed `after` hook does not alter
|
|
5805
|
-
* execution order
|
|
5920
|
+
* - Failed `after` hook does not alter execution order
|
|
5806
5921
|
* - Failed `after each` hook skips remaining tests in a
|
|
5807
5922
|
* suite and subsuites, but executes other `after each`
|
|
5808
5923
|
* hooks
|
|
@@ -5872,34 +5987,37 @@ Runner.prototype.hook = function(name, fn) {
|
|
|
5872
5987
|
if (testError) {
|
|
5873
5988
|
self.fail(self.test, testError);
|
|
5874
5989
|
}
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
);
|
|
5990
|
+
// conditional skip
|
|
5991
|
+
if (hook.pending) {
|
|
5992
|
+
if (name === HOOK_TYPE_AFTER_EACH) {
|
|
5993
|
+
// TODO define and implement use case
|
|
5994
|
+
if (self.test) {
|
|
5995
|
+
self.test.pending = true;
|
|
5882
5996
|
}
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
}
|
|
5887
|
-
} else {
|
|
5888
|
-
suite.tests.forEach(function(test) {
|
|
5889
|
-
test.pending = true;
|
|
5890
|
-
});
|
|
5891
|
-
suite.suites.forEach(function(suite) {
|
|
5892
|
-
suite.pending = true;
|
|
5893
|
-
});
|
|
5894
|
-
// a pending hook won't be executed twice.
|
|
5895
|
-
hook.pending = true;
|
|
5997
|
+
} else if (name === HOOK_TYPE_BEFORE_EACH) {
|
|
5998
|
+
if (self.test) {
|
|
5999
|
+
self.test.pending = true;
|
|
5896
6000
|
}
|
|
6001
|
+
self.emit(constants.EVENT_HOOK_END, hook);
|
|
6002
|
+
hook.pending = false; // activates hook for next test
|
|
6003
|
+
return fn(new Error('abort hookDown'));
|
|
6004
|
+
} else if (name === HOOK_TYPE_BEFORE_ALL) {
|
|
6005
|
+
suite.tests.forEach(function(test) {
|
|
6006
|
+
test.pending = true;
|
|
6007
|
+
});
|
|
6008
|
+
suite.suites.forEach(function(suite) {
|
|
6009
|
+
suite.pending = true;
|
|
6010
|
+
});
|
|
5897
6011
|
} else {
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
return fn(
|
|
6012
|
+
hook.pending = false;
|
|
6013
|
+
var errForbid = createUnsupportedError('`this.skip` forbidden');
|
|
6014
|
+
self.failHook(hook, errForbid);
|
|
6015
|
+
return fn(errForbid);
|
|
5902
6016
|
}
|
|
6017
|
+
} else if (err) {
|
|
6018
|
+
self.failHook(hook, err);
|
|
6019
|
+
// stop executing hooks, notify callee of hook err
|
|
6020
|
+
return fn(err);
|
|
5903
6021
|
}
|
|
5904
6022
|
self.emit(constants.EVENT_HOOK_END, hook);
|
|
5905
6023
|
delete hook.ctx.currentTest;
|
|
@@ -6011,6 +6129,9 @@ Runner.prototype.runTest = function(fn) {
|
|
|
6011
6129
|
test.asyncOnly = true;
|
|
6012
6130
|
}
|
|
6013
6131
|
test.on('error', function(err) {
|
|
6132
|
+
if (err instanceof Pending) {
|
|
6133
|
+
return;
|
|
6134
|
+
}
|
|
6014
6135
|
self.fail(test, err);
|
|
6015
6136
|
});
|
|
6016
6137
|
if (this.allowUncaught) {
|
|
@@ -6106,6 +6227,7 @@ Runner.prototype.runTests = function(suite, fn) {
|
|
|
6106
6227
|
return;
|
|
6107
6228
|
}
|
|
6108
6229
|
|
|
6230
|
+
// static skip, no hooks are executed
|
|
6109
6231
|
if (test.isPending()) {
|
|
6110
6232
|
if (self.forbidPending) {
|
|
6111
6233
|
test.isPending = alwaysFalse;
|
|
@@ -6121,6 +6243,7 @@ Runner.prototype.runTests = function(suite, fn) {
|
|
|
6121
6243
|
// execute test and hook(s)
|
|
6122
6244
|
self.emit(constants.EVENT_TEST_BEGIN, (self.test = test));
|
|
6123
6245
|
self.hookDown(HOOK_TYPE_BEFORE_EACH, function(err, errSuite) {
|
|
6246
|
+
// conditional skip within beforeEach
|
|
6124
6247
|
if (test.isPending()) {
|
|
6125
6248
|
if (self.forbidPending) {
|
|
6126
6249
|
test.isPending = alwaysFalse;
|
|
@@ -6130,7 +6253,13 @@ Runner.prototype.runTests = function(suite, fn) {
|
|
|
6130
6253
|
self.emit(constants.EVENT_TEST_PENDING, test);
|
|
6131
6254
|
}
|
|
6132
6255
|
self.emit(constants.EVENT_TEST_END, test);
|
|
6133
|
-
|
|
6256
|
+
// skip inner afterEach hooks below errSuite level
|
|
6257
|
+
var origSuite = self.suite;
|
|
6258
|
+
self.suite = errSuite || self.suite;
|
|
6259
|
+
return self.hookUp(HOOK_TYPE_AFTER_EACH, function(e, eSuite) {
|
|
6260
|
+
self.suite = origSuite;
|
|
6261
|
+
next(e, eSuite);
|
|
6262
|
+
});
|
|
6134
6263
|
}
|
|
6135
6264
|
if (err) {
|
|
6136
6265
|
return hookErr(err, errSuite, false);
|
|
@@ -6138,14 +6267,20 @@ Runner.prototype.runTests = function(suite, fn) {
|
|
|
6138
6267
|
self.currentRunnable = self.test;
|
|
6139
6268
|
self.runTest(function(err) {
|
|
6140
6269
|
test = self.test;
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
if (
|
|
6270
|
+
// conditional skip within it
|
|
6271
|
+
if (test.pending) {
|
|
6272
|
+
if (self.forbidPending) {
|
|
6273
|
+
test.isPending = alwaysFalse;
|
|
6144
6274
|
self.fail(test, new Error('Pending test forbidden'));
|
|
6145
|
-
|
|
6146
|
-
|
|
6275
|
+
delete test.isPending;
|
|
6276
|
+
} else {
|
|
6147
6277
|
self.emit(constants.EVENT_TEST_PENDING, test);
|
|
6148
|
-
}
|
|
6278
|
+
}
|
|
6279
|
+
self.emit(constants.EVENT_TEST_END, test);
|
|
6280
|
+
return self.hookUp(HOOK_TYPE_AFTER_EACH, next);
|
|
6281
|
+
} else if (err) {
|
|
6282
|
+
var retry = test.currentRetry();
|
|
6283
|
+
if (retry < test.retries()) {
|
|
6149
6284
|
var clonedTest = test.clone();
|
|
6150
6285
|
clonedTest.currentRetry(retry + 1);
|
|
6151
6286
|
tests.unshift(clonedTest);
|
|
@@ -6159,11 +6294,6 @@ Runner.prototype.runTests = function(suite, fn) {
|
|
|
6159
6294
|
self.fail(test, err);
|
|
6160
6295
|
}
|
|
6161
6296
|
self.emit(constants.EVENT_TEST_END, test);
|
|
6162
|
-
|
|
6163
|
-
if (err instanceof Pending) {
|
|
6164
|
-
return next();
|
|
6165
|
-
}
|
|
6166
|
-
|
|
6167
6297
|
return self.hookUp(HOOK_TYPE_AFTER_EACH, next);
|
|
6168
6298
|
}
|
|
6169
6299
|
|
|
@@ -6195,7 +6325,6 @@ Runner.prototype.runSuite = function(suite, fn) {
|
|
|
6195
6325
|
var i = 0;
|
|
6196
6326
|
var self = this;
|
|
6197
6327
|
var total = this.grepTotal(suite);
|
|
6198
|
-
var afterAllHookCalled = false;
|
|
6199
6328
|
|
|
6200
6329
|
debug('run suite %s', suite.fullTitle());
|
|
6201
6330
|
|
|
@@ -6243,21 +6372,13 @@ Runner.prototype.runSuite = function(suite, fn) {
|
|
|
6243
6372
|
self.suite = suite;
|
|
6244
6373
|
self.nextSuite = next;
|
|
6245
6374
|
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
} else {
|
|
6249
|
-
// mark that the afterAll block has been called once
|
|
6250
|
-
// and so can be skipped if there is an error in it.
|
|
6251
|
-
afterAllHookCalled = true;
|
|
6252
|
-
|
|
6253
|
-
// remove reference to test
|
|
6254
|
-
delete self.test;
|
|
6375
|
+
// remove reference to test
|
|
6376
|
+
delete self.test;
|
|
6255
6377
|
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
}
|
|
6378
|
+
self.hook(HOOK_TYPE_AFTER_ALL, function() {
|
|
6379
|
+
self.emit(constants.EVENT_SUITE_END, suite);
|
|
6380
|
+
fn(errSuite);
|
|
6381
|
+
});
|
|
6261
6382
|
}
|
|
6262
6383
|
|
|
6263
6384
|
this.nextSuite = next;
|
|
@@ -6271,7 +6392,7 @@ Runner.prototype.runSuite = function(suite, fn) {
|
|
|
6271
6392
|
};
|
|
6272
6393
|
|
|
6273
6394
|
/**
|
|
6274
|
-
* Handle uncaught exceptions.
|
|
6395
|
+
* Handle uncaught exceptions within runner.
|
|
6275
6396
|
*
|
|
6276
6397
|
* @param {Error} err
|
|
6277
6398
|
* @private
|
|
@@ -6280,6 +6401,11 @@ Runner.prototype.uncaught = function(err) {
|
|
|
6280
6401
|
if (err instanceof Pending) {
|
|
6281
6402
|
return;
|
|
6282
6403
|
}
|
|
6404
|
+
// browser does not exit script when throwing in global.onerror()
|
|
6405
|
+
if (this.allowUncaught && !process.browser) {
|
|
6406
|
+
throw err;
|
|
6407
|
+
}
|
|
6408
|
+
|
|
6283
6409
|
if (err) {
|
|
6284
6410
|
debug('uncaught exception %O', err);
|
|
6285
6411
|
} else {
|
|
@@ -6315,43 +6441,37 @@ Runner.prototype.uncaught = function(err) {
|
|
|
6315
6441
|
|
|
6316
6442
|
runnable.clearTimeout();
|
|
6317
6443
|
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6444
|
+
if (runnable.isFailed()) {
|
|
6445
|
+
// Ignore error if already failed
|
|
6446
|
+
return;
|
|
6447
|
+
} else if (runnable.isPending()) {
|
|
6448
|
+
// report 'pending test' retrospectively as failed
|
|
6449
|
+
runnable.isPending = alwaysFalse;
|
|
6450
|
+
this.fail(runnable, err);
|
|
6451
|
+
delete runnable.isPending;
|
|
6321
6452
|
return;
|
|
6322
6453
|
}
|
|
6454
|
+
|
|
6323
6455
|
// we cannot recover gracefully if a Runnable has already passed
|
|
6324
6456
|
// then fails asynchronously
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
// recover from test
|
|
6330
|
-
if (runnable.type === constants.EVENT_TEST_BEGIN) {
|
|
6331
|
-
this.emit(constants.EVENT_TEST_END, runnable);
|
|
6332
|
-
this.hookUp(HOOK_TYPE_AFTER_EACH, this.next);
|
|
6333
|
-
return;
|
|
6334
|
-
}
|
|
6457
|
+
if (runnable.isPassed()) {
|
|
6458
|
+
this.fail(runnable, err);
|
|
6459
|
+
this.abort();
|
|
6460
|
+
} else {
|
|
6335
6461
|
debug(runnable);
|
|
6336
|
-
|
|
6337
|
-
// recover from hooks
|
|
6338
|
-
var errSuite = this.suite;
|
|
6339
|
-
|
|
6340
|
-
// XXX how about a less awful way to determine this?
|
|
6341
|
-
// if hook failure is in afterEach block
|
|
6342
|
-
if (runnable.fullTitle().indexOf('after each') > -1) {
|
|
6343
|
-
return this.hookErr(err, errSuite, true);
|
|
6344
|
-
}
|
|
6345
|
-
// if hook failure is in beforeEach block
|
|
6346
|
-
if (runnable.fullTitle().indexOf('before each') > -1) {
|
|
6347
|
-
return this.hookErr(err, errSuite, false);
|
|
6348
|
-
}
|
|
6349
|
-
// if hook failure is in after or before blocks
|
|
6350
|
-
return this.nextSuite(errSuite);
|
|
6462
|
+
return runnable.callback(err);
|
|
6351
6463
|
}
|
|
6464
|
+
};
|
|
6352
6465
|
|
|
6353
|
-
|
|
6354
|
-
|
|
6466
|
+
/**
|
|
6467
|
+
* Handle uncaught exceptions after runner's end event.
|
|
6468
|
+
*
|
|
6469
|
+
* @param {Error} err
|
|
6470
|
+
* @private
|
|
6471
|
+
*/
|
|
6472
|
+
Runner.prototype.uncaughtEnd = function uncaughtEnd(err) {
|
|
6473
|
+
if (err instanceof Pending) return;
|
|
6474
|
+
throw err;
|
|
6355
6475
|
};
|
|
6356
6476
|
|
|
6357
6477
|
/**
|
|
@@ -6401,10 +6521,12 @@ Runner.prototype.run = function(fn) {
|
|
|
6401
6521
|
this.on(constants.EVENT_RUN_END, function() {
|
|
6402
6522
|
debug(constants.EVENT_RUN_END);
|
|
6403
6523
|
process.removeListener('uncaughtException', uncaught);
|
|
6524
|
+
process.on('uncaughtException', self.uncaughtEnd);
|
|
6404
6525
|
fn(self.failures);
|
|
6405
6526
|
});
|
|
6406
6527
|
|
|
6407
6528
|
// uncaught exception
|
|
6529
|
+
process.removeListener('uncaughtException', self.uncaughtEnd);
|
|
6408
6530
|
process.on('uncaughtException', uncaught);
|
|
6409
6531
|
|
|
6410
6532
|
if (this._delay) {
|
|
@@ -6511,7 +6633,7 @@ Runner.constants = constants;
|
|
|
6511
6633
|
*/
|
|
6512
6634
|
|
|
6513
6635
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
6514
|
-
},{"./errors":6,"./pending":16,"./runnable":33,"./suite":36,"./utils":38,"_process":
|
|
6636
|
+
},{"./errors":6,"./pending":16,"./runnable":33,"./suite":36,"./utils":38,"_process":69,"debug":45,"events":50,"util":89}],35:[function(require,module,exports){
|
|
6515
6637
|
(function (global){
|
|
6516
6638
|
'use strict';
|
|
6517
6639
|
|
|
@@ -7242,7 +7364,7 @@ var deprecatedEvents = Object.keys(constants)
|
|
|
7242
7364
|
|
|
7243
7365
|
Suite.constants = constants;
|
|
7244
7366
|
|
|
7245
|
-
},{"./errors":6,"./hook":7,"./utils":38,"debug":45,"events":50,"ms":
|
|
7367
|
+
},{"./errors":6,"./hook":7,"./utils":38,"debug":45,"events":50,"ms":60}],37:[function(require,module,exports){
|
|
7246
7368
|
'use strict';
|
|
7247
7369
|
var Runnable = require('./runnable');
|
|
7248
7370
|
var utils = require('./utils');
|
|
@@ -7281,6 +7403,18 @@ function Test(title, fn) {
|
|
|
7281
7403
|
*/
|
|
7282
7404
|
utils.inherits(Test, Runnable);
|
|
7283
7405
|
|
|
7406
|
+
/**
|
|
7407
|
+
* Set or get retried test
|
|
7408
|
+
*
|
|
7409
|
+
* @private
|
|
7410
|
+
*/
|
|
7411
|
+
Test.prototype.retriedTest = function(n) {
|
|
7412
|
+
if (!arguments.length) {
|
|
7413
|
+
return this._retriedTest;
|
|
7414
|
+
}
|
|
7415
|
+
this._retriedTest = n;
|
|
7416
|
+
};
|
|
7417
|
+
|
|
7284
7418
|
Test.prototype.clone = function() {
|
|
7285
7419
|
var test = new Test(this.title, this.fn);
|
|
7286
7420
|
test.timeout(this.timeout());
|
|
@@ -7288,6 +7422,7 @@ Test.prototype.clone = function() {
|
|
|
7288
7422
|
test.enableTimeouts(this.enableTimeouts());
|
|
7289
7423
|
test.retries(this.retries());
|
|
7290
7424
|
test.currentRetry(this.currentRetry());
|
|
7425
|
+
test.retriedTest(this.retriedTest() || this);
|
|
7291
7426
|
test.globals(this.globals());
|
|
7292
7427
|
test.parent = this.parent;
|
|
7293
7428
|
test.file = this.file;
|
|
@@ -7352,80 +7487,6 @@ exports.isString = function(obj) {
|
|
|
7352
7487
|
return typeof obj === 'string';
|
|
7353
7488
|
};
|
|
7354
7489
|
|
|
7355
|
-
/**
|
|
7356
|
-
* Watch the given `files` for changes
|
|
7357
|
-
* and invoke `fn(file)` on modification.
|
|
7358
|
-
*
|
|
7359
|
-
* @private
|
|
7360
|
-
* @param {Array} files
|
|
7361
|
-
* @param {Function} fn
|
|
7362
|
-
*/
|
|
7363
|
-
exports.watch = function(files, fn) {
|
|
7364
|
-
var options = {interval: 100};
|
|
7365
|
-
var debug = require('debug')('mocha:watch');
|
|
7366
|
-
files.forEach(function(file) {
|
|
7367
|
-
debug('file %s', file);
|
|
7368
|
-
fs.watchFile(file, options, function(curr, prev) {
|
|
7369
|
-
if (prev.mtime < curr.mtime) {
|
|
7370
|
-
fn(file);
|
|
7371
|
-
}
|
|
7372
|
-
});
|
|
7373
|
-
});
|
|
7374
|
-
};
|
|
7375
|
-
|
|
7376
|
-
/**
|
|
7377
|
-
* Predicate to screen `pathname` for further consideration.
|
|
7378
|
-
*
|
|
7379
|
-
* @description
|
|
7380
|
-
* Returns <code>false</code> for pathname referencing:
|
|
7381
|
-
* <ul>
|
|
7382
|
-
* <li>'npm' package installation directory
|
|
7383
|
-
* <li>'git' version control directory
|
|
7384
|
-
* </ul>
|
|
7385
|
-
*
|
|
7386
|
-
* @private
|
|
7387
|
-
* @param {string} pathname - File or directory name to screen
|
|
7388
|
-
* @return {boolean} whether pathname should be further considered
|
|
7389
|
-
* @example
|
|
7390
|
-
* ['node_modules', 'test.js'].filter(considerFurther); // => ['test.js']
|
|
7391
|
-
*/
|
|
7392
|
-
function considerFurther(pathname) {
|
|
7393
|
-
var ignore = ['node_modules', '.git'];
|
|
7394
|
-
|
|
7395
|
-
return !~ignore.indexOf(pathname);
|
|
7396
|
-
}
|
|
7397
|
-
|
|
7398
|
-
/**
|
|
7399
|
-
* Lookup files in the given `dir`.
|
|
7400
|
-
*
|
|
7401
|
-
* @description
|
|
7402
|
-
* Filenames are returned in _traversal_ order by the OS/filesystem.
|
|
7403
|
-
* **Make no assumption that the names will be sorted in any fashion.**
|
|
7404
|
-
*
|
|
7405
|
-
* @private
|
|
7406
|
-
* @param {string} dir
|
|
7407
|
-
* @param {string[]} [exts=['js']]
|
|
7408
|
-
* @param {Array} [ret=[]]
|
|
7409
|
-
* @return {Array}
|
|
7410
|
-
*/
|
|
7411
|
-
exports.files = function(dir, exts, ret) {
|
|
7412
|
-
ret = ret || [];
|
|
7413
|
-
exts = exts || ['js'];
|
|
7414
|
-
|
|
7415
|
-
fs.readdirSync(dir)
|
|
7416
|
-
.filter(considerFurther)
|
|
7417
|
-
.forEach(function(dirent) {
|
|
7418
|
-
var pathname = path.join(dir, dirent);
|
|
7419
|
-
if (fs.lstatSync(pathname).isDirectory()) {
|
|
7420
|
-
exports.files(pathname, exts, ret);
|
|
7421
|
-
} else if (hasMatchingExtname(pathname, exts)) {
|
|
7422
|
-
ret.push(pathname);
|
|
7423
|
-
}
|
|
7424
|
-
});
|
|
7425
|
-
|
|
7426
|
-
return ret;
|
|
7427
|
-
};
|
|
7428
|
-
|
|
7429
7490
|
/**
|
|
7430
7491
|
* Compute a slug from the given `str`.
|
|
7431
7492
|
*
|
|
@@ -8205,8 +8266,30 @@ exports.defineConstants = function(obj) {
|
|
|
8205
8266
|
return Object.freeze(exports.createMap(obj));
|
|
8206
8267
|
};
|
|
8207
8268
|
|
|
8269
|
+
/**
|
|
8270
|
+
* Whether current version of Node support ES modules
|
|
8271
|
+
*
|
|
8272
|
+
* @description
|
|
8273
|
+
* Versions prior to 10 did not support ES Modules, and version 10 has an old incompatibile version of ESM.
|
|
8274
|
+
* This function returns whether Node.JS has ES Module supports that is compatible with Mocha's needs,
|
|
8275
|
+
* which is version >=12.11.
|
|
8276
|
+
*
|
|
8277
|
+
* @returns {Boolean} whether the current version of Node.JS supports ES Modules in a way that is compatible with Mocha
|
|
8278
|
+
*/
|
|
8279
|
+
exports.supportsEsModules = function() {
|
|
8280
|
+
if (!process.browser && process.versions && process.versions.node) {
|
|
8281
|
+
var versionFields = process.versions.node.split('.');
|
|
8282
|
+
var major = +versionFields[0];
|
|
8283
|
+
var minor = +versionFields[1];
|
|
8284
|
+
|
|
8285
|
+
if (major >= 13 || (major === 12 && minor >= 11)) {
|
|
8286
|
+
return true;
|
|
8287
|
+
}
|
|
8288
|
+
}
|
|
8289
|
+
};
|
|
8290
|
+
|
|
8208
8291
|
}).call(this,require('_process'),require("buffer").Buffer)
|
|
8209
|
-
},{"./errors":6,"_process":
|
|
8292
|
+
},{"./errors":6,"_process":69,"buffer":43,"fs":42,"glob":42,"he":54,"object.assign":65,"path":42,"util":89}],39:[function(require,module,exports){
|
|
8210
8293
|
'use strict'
|
|
8211
8294
|
|
|
8212
8295
|
exports.byteLength = byteLength
|
|
@@ -8274,8 +8357,7 @@ function toByteArray (b64) {
|
|
|
8274
8357
|
? validLen - 4
|
|
8275
8358
|
: validLen
|
|
8276
8359
|
|
|
8277
|
-
var i
|
|
8278
|
-
for (i = 0; i < len; i += 4) {
|
|
8360
|
+
for (var i = 0; i < len; i += 4) {
|
|
8279
8361
|
tmp =
|
|
8280
8362
|
(revLookup[b64.charCodeAt(i)] << 18) |
|
|
8281
8363
|
(revLookup[b64.charCodeAt(i + 1)] << 12) |
|
|
@@ -8391,7 +8473,7 @@ BrowserStdout.prototype._write = function(chunks, encoding, cb) {
|
|
|
8391
8473
|
}
|
|
8392
8474
|
|
|
8393
8475
|
}).call(this,require('_process'))
|
|
8394
|
-
},{"_process":
|
|
8476
|
+
},{"_process":69,"stream":84,"util":89}],42:[function(require,module,exports){
|
|
8395
8477
|
arguments[4][40][0].apply(exports,arguments)
|
|
8396
8478
|
},{"dup":40}],43:[function(require,module,exports){
|
|
8397
8479
|
(function (Buffer){
|
|
@@ -8407,10 +8489,6 @@ arguments[4][40][0].apply(exports,arguments)
|
|
|
8407
8489
|
|
|
8408
8490
|
var base64 = require('base64-js')
|
|
8409
8491
|
var ieee754 = require('ieee754')
|
|
8410
|
-
var customInspectSymbol =
|
|
8411
|
-
(typeof Symbol === 'function' && typeof Symbol.for === 'function')
|
|
8412
|
-
? Symbol.for('nodejs.util.inspect.custom')
|
|
8413
|
-
: null
|
|
8414
8492
|
|
|
8415
8493
|
exports.Buffer = Buffer
|
|
8416
8494
|
exports.SlowBuffer = SlowBuffer
|
|
@@ -8447,9 +8525,7 @@ function typedArraySupport () {
|
|
|
8447
8525
|
// Can typed array instances can be augmented?
|
|
8448
8526
|
try {
|
|
8449
8527
|
var arr = new Uint8Array(1)
|
|
8450
|
-
|
|
8451
|
-
Object.setPrototypeOf(proto, Uint8Array.prototype)
|
|
8452
|
-
Object.setPrototypeOf(arr, proto)
|
|
8528
|
+
arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
|
|
8453
8529
|
return arr.foo() === 42
|
|
8454
8530
|
} catch (e) {
|
|
8455
8531
|
return false
|
|
@@ -8478,7 +8554,7 @@ function createBuffer (length) {
|
|
|
8478
8554
|
}
|
|
8479
8555
|
// Return an augmented `Uint8Array` instance
|
|
8480
8556
|
var buf = new Uint8Array(length)
|
|
8481
|
-
|
|
8557
|
+
buf.__proto__ = Buffer.prototype
|
|
8482
8558
|
return buf
|
|
8483
8559
|
}
|
|
8484
8560
|
|
|
@@ -8528,7 +8604,7 @@ function from (value, encodingOrOffset, length) {
|
|
|
8528
8604
|
}
|
|
8529
8605
|
|
|
8530
8606
|
if (value == null) {
|
|
8531
|
-
throw
|
|
8607
|
+
throw TypeError(
|
|
8532
8608
|
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
|
|
8533
8609
|
'or Array-like Object. Received type ' + (typeof value)
|
|
8534
8610
|
)
|
|
@@ -8539,12 +8615,6 @@ function from (value, encodingOrOffset, length) {
|
|
|
8539
8615
|
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
8540
8616
|
}
|
|
8541
8617
|
|
|
8542
|
-
if (typeof SharedArrayBuffer !== 'undefined' &&
|
|
8543
|
-
(isInstance(value, SharedArrayBuffer) ||
|
|
8544
|
-
(value && isInstance(value.buffer, SharedArrayBuffer)))) {
|
|
8545
|
-
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
8546
|
-
}
|
|
8547
|
-
|
|
8548
8618
|
if (typeof value === 'number') {
|
|
8549
8619
|
throw new TypeError(
|
|
8550
8620
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -8586,8 +8656,8 @@ Buffer.from = function (value, encodingOrOffset, length) {
|
|
|
8586
8656
|
|
|
8587
8657
|
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
|
|
8588
8658
|
// https://github.com/feross/buffer/pull/148
|
|
8589
|
-
|
|
8590
|
-
|
|
8659
|
+
Buffer.prototype.__proto__ = Uint8Array.prototype
|
|
8660
|
+
Buffer.__proto__ = Uint8Array
|
|
8591
8661
|
|
|
8592
8662
|
function assertSize (size) {
|
|
8593
8663
|
if (typeof size !== 'number') {
|
|
@@ -8691,8 +8761,7 @@ function fromArrayBuffer (array, byteOffset, length) {
|
|
|
8691
8761
|
}
|
|
8692
8762
|
|
|
8693
8763
|
// Return an augmented `Uint8Array` instance
|
|
8694
|
-
|
|
8695
|
-
|
|
8764
|
+
buf.__proto__ = Buffer.prototype
|
|
8696
8765
|
return buf
|
|
8697
8766
|
}
|
|
8698
8767
|
|
|
@@ -9014,9 +9083,6 @@ Buffer.prototype.inspect = function inspect () {
|
|
|
9014
9083
|
if (this.length > max) str += ' ... '
|
|
9015
9084
|
return '<Buffer ' + str + '>'
|
|
9016
9085
|
}
|
|
9017
|
-
if (customInspectSymbol) {
|
|
9018
|
-
Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
|
|
9019
|
-
}
|
|
9020
9086
|
|
|
9021
9087
|
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
|
|
9022
9088
|
if (isInstance(target, Uint8Array)) {
|
|
@@ -9142,7 +9208,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
|
|
|
9142
9208
|
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
|
|
9143
9209
|
}
|
|
9144
9210
|
}
|
|
9145
|
-
return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
|
|
9211
|
+
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
|
|
9146
9212
|
}
|
|
9147
9213
|
|
|
9148
9214
|
throw new TypeError('val must be string, number or Buffer')
|
|
@@ -9471,7 +9537,7 @@ function hexSlice (buf, start, end) {
|
|
|
9471
9537
|
|
|
9472
9538
|
var out = ''
|
|
9473
9539
|
for (var i = start; i < end; ++i) {
|
|
9474
|
-
out +=
|
|
9540
|
+
out += toHex(buf[i])
|
|
9475
9541
|
}
|
|
9476
9542
|
return out
|
|
9477
9543
|
}
|
|
@@ -9508,8 +9574,7 @@ Buffer.prototype.slice = function slice (start, end) {
|
|
|
9508
9574
|
|
|
9509
9575
|
var newBuf = this.subarray(start, end)
|
|
9510
9576
|
// Return an augmented `Uint8Array` instance
|
|
9511
|
-
|
|
9512
|
-
|
|
9577
|
+
newBuf.__proto__ = Buffer.prototype
|
|
9513
9578
|
return newBuf
|
|
9514
9579
|
}
|
|
9515
9580
|
|
|
@@ -9998,8 +10063,6 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|
|
9998
10063
|
}
|
|
9999
10064
|
} else if (typeof val === 'number') {
|
|
10000
10065
|
val = val & 255
|
|
10001
|
-
} else if (typeof val === 'boolean') {
|
|
10002
|
-
val = Number(val)
|
|
10003
10066
|
}
|
|
10004
10067
|
|
|
10005
10068
|
// Invalid ranges are not set to a default, so can range check early.
|
|
@@ -10057,6 +10120,11 @@ function base64clean (str) {
|
|
|
10057
10120
|
return str
|
|
10058
10121
|
}
|
|
10059
10122
|
|
|
10123
|
+
function toHex (n) {
|
|
10124
|
+
if (n < 16) return '0' + n.toString(16)
|
|
10125
|
+
return n.toString(16)
|
|
10126
|
+
}
|
|
10127
|
+
|
|
10060
10128
|
function utf8ToBytes (string, units) {
|
|
10061
10129
|
units = units || Infinity
|
|
10062
10130
|
var codePoint
|
|
@@ -10187,20 +10255,6 @@ function numberIsNaN (obj) {
|
|
|
10187
10255
|
return obj !== obj // eslint-disable-line no-self-compare
|
|
10188
10256
|
}
|
|
10189
10257
|
|
|
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
|
-
|
|
10204
10258
|
}).call(this,require("buffer").Buffer)
|
|
10205
10259
|
},{"base64-js":39,"buffer":43,"ieee754":55}],44:[function(require,module,exports){
|
|
10206
10260
|
(function (Buffer){
|
|
@@ -10497,7 +10551,7 @@ formatters.j = function (v) {
|
|
|
10497
10551
|
|
|
10498
10552
|
|
|
10499
10553
|
}).call(this,require('_process'))
|
|
10500
|
-
},{"./common":46,"_process":
|
|
10554
|
+
},{"./common":46,"_process":69}],46:[function(require,module,exports){
|
|
10501
10555
|
"use strict";
|
|
10502
10556
|
|
|
10503
10557
|
/**
|
|
@@ -10748,7 +10802,7 @@ function setup(env) {
|
|
|
10748
10802
|
module.exports = setup;
|
|
10749
10803
|
|
|
10750
10804
|
|
|
10751
|
-
},{"ms":
|
|
10805
|
+
},{"ms":60}],47:[function(require,module,exports){
|
|
10752
10806
|
'use strict';
|
|
10753
10807
|
|
|
10754
10808
|
var keys = require('object-keys');
|
|
@@ -10808,7 +10862,7 @@ defineProperties.supportsDescriptors = !!supportsDescriptors;
|
|
|
10808
10862
|
|
|
10809
10863
|
module.exports = defineProperties;
|
|
10810
10864
|
|
|
10811
|
-
},{"object-keys":
|
|
10865
|
+
},{"object-keys":62}],48:[function(require,module,exports){
|
|
10812
10866
|
/*!
|
|
10813
10867
|
|
|
10814
10868
|
diff v3.5.0
|
|
@@ -13254,7 +13308,7 @@ module.exports = Function.prototype.bind || implementation;
|
|
|
13254
13308
|
},{"./implementation":51}],53:[function(require,module,exports){
|
|
13255
13309
|
'use strict';
|
|
13256
13310
|
|
|
13257
|
-
/* eslint complexity: [2,
|
|
13311
|
+
/* eslint complexity: [2, 17], max-statements: [2, 33] */
|
|
13258
13312
|
module.exports = function hasSymbols() {
|
|
13259
13313
|
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
13260
13314
|
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
@@ -13732,28 +13786,24 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
13732
13786
|
if (typeof Object.create === 'function') {
|
|
13733
13787
|
// implementation from standard node.js 'util' module
|
|
13734
13788
|
module.exports = function inherits(ctor, superCtor) {
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
})
|
|
13745
|
-
}
|
|
13789
|
+
ctor.super_ = superCtor
|
|
13790
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
13791
|
+
constructor: {
|
|
13792
|
+
value: ctor,
|
|
13793
|
+
enumerable: false,
|
|
13794
|
+
writable: true,
|
|
13795
|
+
configurable: true
|
|
13796
|
+
}
|
|
13797
|
+
});
|
|
13746
13798
|
};
|
|
13747
13799
|
} else {
|
|
13748
13800
|
// old school shim for old browsers
|
|
13749
13801
|
module.exports = function inherits(ctor, superCtor) {
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
ctor.prototype.constructor = ctor
|
|
13756
|
-
}
|
|
13802
|
+
ctor.super_ = superCtor
|
|
13803
|
+
var TempCtor = function () {}
|
|
13804
|
+
TempCtor.prototype = superCtor.prototype
|
|
13805
|
+
ctor.prototype = new TempCtor()
|
|
13806
|
+
ctor.prototype.constructor = ctor
|
|
13757
13807
|
}
|
|
13758
13808
|
}
|
|
13759
13809
|
|
|
@@ -13765,12 +13815,29 @@ if (typeof Object.create === 'function') {
|
|
|
13765
13815
|
* @license MIT
|
|
13766
13816
|
*/
|
|
13767
13817
|
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13818
|
+
// The _isBuffer check is for Safari 5-7 support, because it's missing
|
|
13819
|
+
// Object.prototype.constructor. Remove this eventually
|
|
13820
|
+
module.exports = function (obj) {
|
|
13821
|
+
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
|
|
13822
|
+
}
|
|
13823
|
+
|
|
13824
|
+
function isBuffer (obj) {
|
|
13825
|
+
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
|
13826
|
+
}
|
|
13827
|
+
|
|
13828
|
+
// For Node v0.10 support. Remove this eventually.
|
|
13829
|
+
function isSlowBuffer (obj) {
|
|
13830
|
+
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
|
13771
13831
|
}
|
|
13772
13832
|
|
|
13773
13833
|
},{}],58:[function(require,module,exports){
|
|
13834
|
+
var toString = {}.toString;
|
|
13835
|
+
|
|
13836
|
+
module.exports = Array.isArray || function (arr) {
|
|
13837
|
+
return toString.call(arr) == '[object Array]';
|
|
13838
|
+
};
|
|
13839
|
+
|
|
13840
|
+
},{}],59:[function(require,module,exports){
|
|
13774
13841
|
(function (process){
|
|
13775
13842
|
var path = require('path');
|
|
13776
13843
|
var fs = require('fs');
|
|
@@ -13805,7 +13872,6 @@ function mkdirP (p, opts, f, made) {
|
|
|
13805
13872
|
}
|
|
13806
13873
|
switch (er.code) {
|
|
13807
13874
|
case 'ENOENT':
|
|
13808
|
-
if (path.dirname(p) === p) return cb(er);
|
|
13809
13875
|
mkdirP(path.dirname(p), opts, function (er, made) {
|
|
13810
13876
|
if (er) cb(er, made);
|
|
13811
13877
|
else mkdirP(p, opts, cb, made);
|
|
@@ -13873,7 +13939,7 @@ mkdirP.sync = function sync (p, opts, made) {
|
|
|
13873
13939
|
};
|
|
13874
13940
|
|
|
13875
13941
|
}).call(this,require('_process'))
|
|
13876
|
-
},{"_process":
|
|
13942
|
+
},{"_process":69,"fs":42,"path":42}],60:[function(require,module,exports){
|
|
13877
13943
|
/**
|
|
13878
13944
|
* Helpers.
|
|
13879
13945
|
*/
|
|
@@ -14037,7 +14103,7 @@ function plural(ms, msAbs, n, name) {
|
|
|
14037
14103
|
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
14038
14104
|
}
|
|
14039
14105
|
|
|
14040
|
-
},{}],
|
|
14106
|
+
},{}],61:[function(require,module,exports){
|
|
14041
14107
|
'use strict';
|
|
14042
14108
|
|
|
14043
14109
|
var keysShim;
|
|
@@ -14071,8 +14137,6 @@ if (!Object.keys) {
|
|
|
14071
14137
|
$frames: true,
|
|
14072
14138
|
$innerHeight: true,
|
|
14073
14139
|
$innerWidth: true,
|
|
14074
|
-
$onmozfullscreenchange: true,
|
|
14075
|
-
$onmozfullscreenerror: true,
|
|
14076
14140
|
$outerHeight: true,
|
|
14077
14141
|
$outerWidth: true,
|
|
14078
14142
|
$pageXOffset: true,
|
|
@@ -14161,7 +14225,7 @@ if (!Object.keys) {
|
|
|
14161
14225
|
}
|
|
14162
14226
|
module.exports = keysShim;
|
|
14163
14227
|
|
|
14164
|
-
},{"./isArguments":
|
|
14228
|
+
},{"./isArguments":63}],62:[function(require,module,exports){
|
|
14165
14229
|
'use strict';
|
|
14166
14230
|
|
|
14167
14231
|
var slice = Array.prototype.slice;
|
|
@@ -14195,7 +14259,7 @@ keysShim.shim = function shimObjectKeys() {
|
|
|
14195
14259
|
|
|
14196
14260
|
module.exports = keysShim;
|
|
14197
14261
|
|
|
14198
|
-
},{"./implementation":
|
|
14262
|
+
},{"./implementation":61,"./isArguments":63}],63:[function(require,module,exports){
|
|
14199
14263
|
'use strict';
|
|
14200
14264
|
|
|
14201
14265
|
var toStr = Object.prototype.toString;
|
|
@@ -14214,7 +14278,7 @@ module.exports = function isArguments(value) {
|
|
|
14214
14278
|
return isArgs;
|
|
14215
14279
|
};
|
|
14216
14280
|
|
|
14217
|
-
},{}],
|
|
14281
|
+
},{}],64:[function(require,module,exports){
|
|
14218
14282
|
'use strict';
|
|
14219
14283
|
|
|
14220
14284
|
// modified from https://github.com/es-shims/es6-shim
|
|
@@ -14257,7 +14321,7 @@ module.exports = function assign(target, source1) {
|
|
|
14257
14321
|
return objTarget;
|
|
14258
14322
|
};
|
|
14259
14323
|
|
|
14260
|
-
},{"function-bind":52,"has-symbols/shams":53,"object-keys":
|
|
14324
|
+
},{"function-bind":52,"has-symbols/shams":53,"object-keys":62}],65:[function(require,module,exports){
|
|
14261
14325
|
'use strict';
|
|
14262
14326
|
|
|
14263
14327
|
var defineProperties = require('define-properties');
|
|
@@ -14276,7 +14340,7 @@ defineProperties(polyfill, {
|
|
|
14276
14340
|
|
|
14277
14341
|
module.exports = polyfill;
|
|
14278
14342
|
|
|
14279
|
-
},{"./implementation":
|
|
14343
|
+
},{"./implementation":64,"./polyfill":66,"./shim":67,"define-properties":47}],66:[function(require,module,exports){
|
|
14280
14344
|
'use strict';
|
|
14281
14345
|
|
|
14282
14346
|
var implementation = require('./implementation');
|
|
@@ -14329,7 +14393,7 @@ module.exports = function getPolyfill() {
|
|
|
14329
14393
|
return Object.assign;
|
|
14330
14394
|
};
|
|
14331
14395
|
|
|
14332
|
-
},{"./implementation":
|
|
14396
|
+
},{"./implementation":64}],67:[function(require,module,exports){
|
|
14333
14397
|
'use strict';
|
|
14334
14398
|
|
|
14335
14399
|
var define = require('define-properties');
|
|
@@ -14345,12 +14409,11 @@ module.exports = function shimAssign() {
|
|
|
14345
14409
|
return polyfill;
|
|
14346
14410
|
};
|
|
14347
14411
|
|
|
14348
|
-
},{"./polyfill":
|
|
14412
|
+
},{"./polyfill":66,"define-properties":47}],68:[function(require,module,exports){
|
|
14349
14413
|
(function (process){
|
|
14350
14414
|
'use strict';
|
|
14351
14415
|
|
|
14352
|
-
if (
|
|
14353
|
-
!process.version ||
|
|
14416
|
+
if (!process.version ||
|
|
14354
14417
|
process.version.indexOf('v0.') === 0 ||
|
|
14355
14418
|
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
|
|
14356
14419
|
module.exports = { nextTick: nextTick };
|
|
@@ -14394,7 +14457,7 @@ function nextTick(fn, arg1, arg2, arg3) {
|
|
|
14394
14457
|
|
|
14395
14458
|
|
|
14396
14459
|
}).call(this,require('_process'))
|
|
14397
|
-
},{"_process":
|
|
14460
|
+
},{"_process":69}],69:[function(require,module,exports){
|
|
14398
14461
|
// shim for using process in browser
|
|
14399
14462
|
var process = module.exports = {};
|
|
14400
14463
|
|
|
@@ -14580,10 +14643,10 @@ process.chdir = function (dir) {
|
|
|
14580
14643
|
};
|
|
14581
14644
|
process.umask = function() { return 0; };
|
|
14582
14645
|
|
|
14583
|
-
},{}],
|
|
14646
|
+
},{}],70:[function(require,module,exports){
|
|
14584
14647
|
module.exports = require('./lib/_stream_duplex.js');
|
|
14585
14648
|
|
|
14586
|
-
},{"./lib/_stream_duplex.js":
|
|
14649
|
+
},{"./lib/_stream_duplex.js":71}],71:[function(require,module,exports){
|
|
14587
14650
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
14588
14651
|
//
|
|
14589
14652
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -14629,7 +14692,7 @@ var objectKeys = Object.keys || function (obj) {
|
|
|
14629
14692
|
module.exports = Duplex;
|
|
14630
14693
|
|
|
14631
14694
|
/*<replacement>*/
|
|
14632
|
-
var util =
|
|
14695
|
+
var util = require('core-util-is');
|
|
14633
14696
|
util.inherits = require('inherits');
|
|
14634
14697
|
/*</replacement>*/
|
|
14635
14698
|
|
|
@@ -14715,7 +14778,7 @@ Duplex.prototype._destroy = function (err, cb) {
|
|
|
14715
14778
|
|
|
14716
14779
|
pna.nextTick(cb, err);
|
|
14717
14780
|
};
|
|
14718
|
-
},{"./_stream_readable":
|
|
14781
|
+
},{"./_stream_readable":73,"./_stream_writable":75,"core-util-is":44,"inherits":56,"process-nextick-args":68}],72:[function(require,module,exports){
|
|
14719
14782
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
14720
14783
|
//
|
|
14721
14784
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -14748,7 +14811,7 @@ module.exports = PassThrough;
|
|
|
14748
14811
|
var Transform = require('./_stream_transform');
|
|
14749
14812
|
|
|
14750
14813
|
/*<replacement>*/
|
|
14751
|
-
var util =
|
|
14814
|
+
var util = require('core-util-is');
|
|
14752
14815
|
util.inherits = require('inherits');
|
|
14753
14816
|
/*</replacement>*/
|
|
14754
14817
|
|
|
@@ -14763,7 +14826,7 @@ function PassThrough(options) {
|
|
|
14763
14826
|
PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
|
14764
14827
|
cb(null, chunk);
|
|
14765
14828
|
};
|
|
14766
|
-
},{"./_stream_transform":
|
|
14829
|
+
},{"./_stream_transform":74,"core-util-is":44,"inherits":56}],73:[function(require,module,exports){
|
|
14767
14830
|
(function (process,global){
|
|
14768
14831
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
14769
14832
|
//
|
|
@@ -14831,7 +14894,7 @@ function _isUint8Array(obj) {
|
|
|
14831
14894
|
/*</replacement>*/
|
|
14832
14895
|
|
|
14833
14896
|
/*<replacement>*/
|
|
14834
|
-
var util =
|
|
14897
|
+
var util = require('core-util-is');
|
|
14835
14898
|
util.inherits = require('inherits');
|
|
14836
14899
|
/*</replacement>*/
|
|
14837
14900
|
|
|
@@ -15785,7 +15848,7 @@ function indexOf(xs, x) {
|
|
|
15785
15848
|
return -1;
|
|
15786
15849
|
}
|
|
15787
15850
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
15788
|
-
},{"./_stream_duplex":
|
|
15851
|
+
},{"./_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){
|
|
15789
15852
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
15790
15853
|
//
|
|
15791
15854
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -15856,7 +15919,7 @@ module.exports = Transform;
|
|
|
15856
15919
|
var Duplex = require('./_stream_duplex');
|
|
15857
15920
|
|
|
15858
15921
|
/*<replacement>*/
|
|
15859
|
-
var util =
|
|
15922
|
+
var util = require('core-util-is');
|
|
15860
15923
|
util.inherits = require('inherits');
|
|
15861
15924
|
/*</replacement>*/
|
|
15862
15925
|
|
|
@@ -16000,7 +16063,7 @@ function done(stream, er, data) {
|
|
|
16000
16063
|
|
|
16001
16064
|
return stream.push(null);
|
|
16002
16065
|
}
|
|
16003
|
-
},{"./_stream_duplex":
|
|
16066
|
+
},{"./_stream_duplex":71,"core-util-is":44,"inherits":56}],75:[function(require,module,exports){
|
|
16004
16067
|
(function (process,global,setImmediate){
|
|
16005
16068
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
16006
16069
|
//
|
|
@@ -16068,7 +16131,7 @@ var Duplex;
|
|
|
16068
16131
|
Writable.WritableState = WritableState;
|
|
16069
16132
|
|
|
16070
16133
|
/*<replacement>*/
|
|
16071
|
-
var util =
|
|
16134
|
+
var util = require('core-util-is');
|
|
16072
16135
|
util.inherits = require('inherits');
|
|
16073
16136
|
/*</replacement>*/
|
|
16074
16137
|
|
|
@@ -16690,7 +16753,7 @@ Writable.prototype._destroy = function (err, cb) {
|
|
|
16690
16753
|
cb(err);
|
|
16691
16754
|
};
|
|
16692
16755
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
|
|
16693
|
-
},{"./_stream_duplex":
|
|
16756
|
+
},{"./_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){
|
|
16694
16757
|
'use strict';
|
|
16695
16758
|
|
|
16696
16759
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -16770,7 +16833,7 @@ if (util && util.inspect && util.inspect.custom) {
|
|
|
16770
16833
|
return this.constructor.name + ' ' + obj;
|
|
16771
16834
|
};
|
|
16772
16835
|
}
|
|
16773
|
-
},{"safe-buffer":83,"util":40}],
|
|
16836
|
+
},{"safe-buffer":83,"util":40}],77:[function(require,module,exports){
|
|
16774
16837
|
'use strict';
|
|
16775
16838
|
|
|
16776
16839
|
/*<replacement>*/
|
|
@@ -16845,17 +16908,10 @@ module.exports = {
|
|
|
16845
16908
|
destroy: destroy,
|
|
16846
16909
|
undestroy: undestroy
|
|
16847
16910
|
};
|
|
16848
|
-
},{"process-nextick-args":
|
|
16911
|
+
},{"process-nextick-args":68}],78:[function(require,module,exports){
|
|
16849
16912
|
module.exports = require('events').EventEmitter;
|
|
16850
16913
|
|
|
16851
|
-
},{"events":50}],
|
|
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){
|
|
16914
|
+
},{"events":50}],79:[function(require,module,exports){
|
|
16859
16915
|
module.exports = require('./readable').PassThrough
|
|
16860
16916
|
|
|
16861
16917
|
},{"./readable":80}],80:[function(require,module,exports){
|
|
@@ -16867,13 +16923,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
|
|
|
16867
16923
|
exports.Transform = require('./lib/_stream_transform.js');
|
|
16868
16924
|
exports.PassThrough = require('./lib/_stream_passthrough.js');
|
|
16869
16925
|
|
|
16870
|
-
},{"./lib/_stream_duplex.js":
|
|
16926
|
+
},{"./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){
|
|
16871
16927
|
module.exports = require('./readable').Transform
|
|
16872
16928
|
|
|
16873
16929
|
},{"./readable":80}],82:[function(require,module,exports){
|
|
16874
16930
|
module.exports = require('./lib/_stream_writable.js');
|
|
16875
16931
|
|
|
16876
|
-
},{"./lib/_stream_writable.js":
|
|
16932
|
+
},{"./lib/_stream_writable.js":75}],83:[function(require,module,exports){
|
|
16877
16933
|
/* eslint-disable node/no-deprecated-api */
|
|
16878
16934
|
var buffer = require('buffer')
|
|
16879
16935
|
var Buffer = buffer.Buffer
|
|
@@ -17066,7 +17122,7 @@ Stream.prototype.pipe = function(dest, options) {
|
|
|
17066
17122
|
return dest;
|
|
17067
17123
|
};
|
|
17068
17124
|
|
|
17069
|
-
},{"events":50,"inherits":56,"readable-stream/duplex.js":
|
|
17125
|
+
},{"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){
|
|
17070
17126
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
17071
17127
|
//
|
|
17072
17128
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -17442,7 +17498,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
|
|
|
17442
17498
|
delete immediateIds[id];
|
|
17443
17499
|
};
|
|
17444
17500
|
}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
|
|
17445
|
-
},{"process/browser.js":
|
|
17501
|
+
},{"process/browser.js":69,"timers":86}],87:[function(require,module,exports){
|
|
17446
17502
|
(function (global){
|
|
17447
17503
|
|
|
17448
17504
|
/**
|
|
@@ -17514,38 +17570,13 @@ function config (name) {
|
|
|
17514
17570
|
|
|
17515
17571
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
17516
17572
|
},{}],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){
|
|
17542
17573
|
module.exports = function isBuffer(arg) {
|
|
17543
17574
|
return arg && typeof arg === 'object'
|
|
17544
17575
|
&& typeof arg.copy === 'function'
|
|
17545
17576
|
&& typeof arg.fill === 'function'
|
|
17546
17577
|
&& typeof arg.readUInt8 === 'function';
|
|
17547
17578
|
}
|
|
17548
|
-
},{}],
|
|
17579
|
+
},{}],89:[function(require,module,exports){
|
|
17549
17580
|
(function (process,global){
|
|
17550
17581
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
17551
17582
|
//
|
|
@@ -18135,10 +18166,10 @@ function hasOwnProperty(obj, prop) {
|
|
|
18135
18166
|
}
|
|
18136
18167
|
|
|
18137
18168
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
18138
|
-
},{"./support/isBuffer":
|
|
18169
|
+
},{"./support/isBuffer":88,"_process":69,"inherits":56}],90:[function(require,module,exports){
|
|
18139
18170
|
module.exports={
|
|
18140
18171
|
"name": "mocha",
|
|
18141
|
-
"version": "
|
|
18172
|
+
"version": "7.1.0",
|
|
18142
18173
|
"homepage": "https://mochajs.org/",
|
|
18143
18174
|
"notifyLogo": "https://ibin.co/4QuRuGjXvl36.png"
|
|
18144
18175
|
}
|