mocha 7.1.1 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/lib/runnable.js +0 -25
- package/lib/runner.js +3 -8
- package/lib/utils.js +0 -32
- package/mocha.js +8 -71
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# 7.1.2 / 2020-04-26
|
|
2
|
+
|
|
3
|
+
## :nut_and_bolt: Other
|
|
4
|
+
|
|
5
|
+
- [#4251](https://github.com/mochajs/mocha/issues/4251): Prevent karma-mocha from stalling ([**@juergba**](https://github.com/juergba))
|
|
6
|
+
- [#4222](https://github.com/mochajs/mocha/issues/4222): Update dependency mkdirp to v0.5.5 ([**@outsideris**](https://github.com/outsideris))
|
|
7
|
+
|
|
8
|
+
## :book: Documentation
|
|
9
|
+
|
|
10
|
+
- [#4208](https://github.com/mochajs/mocha/issues/4208): Add Wallaby logo to site ([**@boneskull**](https://github.com/boneskull))
|
|
11
|
+
|
|
1
12
|
# 7.1.1 / 2020-03-18
|
|
2
13
|
|
|
3
14
|
## :lock: Security Fixes
|
package/lib/runnable.js
CHANGED
|
@@ -222,31 +222,6 @@ Runnable.prototype.clearTimeout = function() {
|
|
|
222
222
|
clearTimeout(this.timer);
|
|
223
223
|
};
|
|
224
224
|
|
|
225
|
-
/**
|
|
226
|
-
* Inspect the runnable void of private properties.
|
|
227
|
-
*
|
|
228
|
-
* @private
|
|
229
|
-
* @return {string}
|
|
230
|
-
*/
|
|
231
|
-
Runnable.prototype.inspect = function() {
|
|
232
|
-
return JSON.stringify(
|
|
233
|
-
this,
|
|
234
|
-
function(key, val) {
|
|
235
|
-
if (key[0] === '_') {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (key === 'parent') {
|
|
239
|
-
return '#<Suite>';
|
|
240
|
-
}
|
|
241
|
-
if (key === 'ctx') {
|
|
242
|
-
return '#<Context>';
|
|
243
|
-
}
|
|
244
|
-
return val;
|
|
245
|
-
},
|
|
246
|
-
2
|
|
247
|
-
);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
225
|
/**
|
|
251
226
|
* Reset the timeout.
|
|
252
227
|
*
|
package/lib/runner.js
CHANGED
|
@@ -19,7 +19,6 @@ var EVENT_ROOT_SUITE_RUN = Suite.constants.EVENT_ROOT_SUITE_RUN;
|
|
|
19
19
|
var STATE_FAILED = Runnable.constants.STATE_FAILED;
|
|
20
20
|
var STATE_PASSED = Runnable.constants.STATE_PASSED;
|
|
21
21
|
var dQuote = utils.dQuote;
|
|
22
|
-
var ngettext = utils.ngettext;
|
|
23
22
|
var sQuote = utils.sQuote;
|
|
24
23
|
var stackFilter = utils.stackTraceFilter();
|
|
25
24
|
var stringify = utils.stringify;
|
|
@@ -135,7 +134,7 @@ function Runner(suite, delay) {
|
|
|
135
134
|
this.total = suite.total();
|
|
136
135
|
this.failures = 0;
|
|
137
136
|
this.on(constants.EVENT_TEST_END, function(test) {
|
|
138
|
-
if (test.retriedTest() && test.parent) {
|
|
137
|
+
if (test.type === 'test' && test.retriedTest() && test.parent) {
|
|
139
138
|
var idx =
|
|
140
139
|
test.parent.tests && test.parent.tests.indexOf(test.retriedTest());
|
|
141
140
|
if (idx > -1) test.parent.tests[idx] = test;
|
|
@@ -271,12 +270,8 @@ Runner.prototype.checkGlobals = function(test) {
|
|
|
271
270
|
this._globals = this._globals.concat(leaks);
|
|
272
271
|
|
|
273
272
|
if (leaks.length) {
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
'global leak detected: %s',
|
|
277
|
-
'global leaks detected: %s'
|
|
278
|
-
);
|
|
279
|
-
var error = new Error(util.format(format, leaks.map(sQuote).join(', ')));
|
|
273
|
+
var msg = 'global leak(s) detected: %s';
|
|
274
|
+
var error = new Error(util.format(msg, leaks.map(sQuote).join(', ')));
|
|
280
275
|
this.fail(test, error);
|
|
281
276
|
}
|
|
282
277
|
};
|
package/lib/utils.js
CHANGED
|
@@ -753,38 +753,6 @@ exports.dQuote = function(str) {
|
|
|
753
753
|
return '"' + str + '"';
|
|
754
754
|
};
|
|
755
755
|
|
|
756
|
-
/**
|
|
757
|
-
* Provides simplistic message translation for dealing with plurality.
|
|
758
|
-
*
|
|
759
|
-
* @description
|
|
760
|
-
* Use this to create messages which need to be singular or plural.
|
|
761
|
-
* Some languages have several plural forms, so _complete_ message clauses
|
|
762
|
-
* are preferable to generating the message on the fly.
|
|
763
|
-
*
|
|
764
|
-
* @private
|
|
765
|
-
* @param {number} n - Non-negative integer
|
|
766
|
-
* @param {string} msg1 - Message to be used in English for `n = 1`
|
|
767
|
-
* @param {string} msg2 - Message to be used in English for `n = 0, 2, 3, ...`
|
|
768
|
-
* @returns {string} message corresponding to value of `n`
|
|
769
|
-
* @example
|
|
770
|
-
* var sprintf = require('util').format;
|
|
771
|
-
* var pkgs = ['one', 'two'];
|
|
772
|
-
* var msg = sprintf(
|
|
773
|
-
* ngettext(
|
|
774
|
-
* pkgs.length,
|
|
775
|
-
* 'cannot load package: %s',
|
|
776
|
-
* 'cannot load packages: %s'
|
|
777
|
-
* ),
|
|
778
|
-
* pkgs.map(sQuote).join(', ')
|
|
779
|
-
* );
|
|
780
|
-
* console.log(msg); // => cannot load packages: 'one', 'two'
|
|
781
|
-
*/
|
|
782
|
-
exports.ngettext = function(n, msg1, msg2) {
|
|
783
|
-
if (typeof n === 'number' && n >= 0) {
|
|
784
|
-
return n === 1 ? msg1 : msg2;
|
|
785
|
-
}
|
|
786
|
-
};
|
|
787
|
-
|
|
788
756
|
/**
|
|
789
757
|
* It's a noop.
|
|
790
758
|
* @public
|
package/mocha.js
CHANGED
|
@@ -5310,31 +5310,6 @@ Runnable.prototype.clearTimeout = function() {
|
|
|
5310
5310
|
clearTimeout(this.timer);
|
|
5311
5311
|
};
|
|
5312
5312
|
|
|
5313
|
-
/**
|
|
5314
|
-
* Inspect the runnable void of private properties.
|
|
5315
|
-
*
|
|
5316
|
-
* @private
|
|
5317
|
-
* @return {string}
|
|
5318
|
-
*/
|
|
5319
|
-
Runnable.prototype.inspect = function() {
|
|
5320
|
-
return JSON.stringify(
|
|
5321
|
-
this,
|
|
5322
|
-
function(key, val) {
|
|
5323
|
-
if (key[0] === '_') {
|
|
5324
|
-
return;
|
|
5325
|
-
}
|
|
5326
|
-
if (key === 'parent') {
|
|
5327
|
-
return '#<Suite>';
|
|
5328
|
-
}
|
|
5329
|
-
if (key === 'ctx') {
|
|
5330
|
-
return '#<Context>';
|
|
5331
|
-
}
|
|
5332
|
-
return val;
|
|
5333
|
-
},
|
|
5334
|
-
2
|
|
5335
|
-
);
|
|
5336
|
-
};
|
|
5337
|
-
|
|
5338
5313
|
/**
|
|
5339
5314
|
* Reset the timeout.
|
|
5340
5315
|
*
|
|
@@ -5615,7 +5590,6 @@ var EVENT_ROOT_SUITE_RUN = Suite.constants.EVENT_ROOT_SUITE_RUN;
|
|
|
5615
5590
|
var STATE_FAILED = Runnable.constants.STATE_FAILED;
|
|
5616
5591
|
var STATE_PASSED = Runnable.constants.STATE_PASSED;
|
|
5617
5592
|
var dQuote = utils.dQuote;
|
|
5618
|
-
var ngettext = utils.ngettext;
|
|
5619
5593
|
var sQuote = utils.sQuote;
|
|
5620
5594
|
var stackFilter = utils.stackTraceFilter();
|
|
5621
5595
|
var stringify = utils.stringify;
|
|
@@ -5731,7 +5705,7 @@ function Runner(suite, delay) {
|
|
|
5731
5705
|
this.total = suite.total();
|
|
5732
5706
|
this.failures = 0;
|
|
5733
5707
|
this.on(constants.EVENT_TEST_END, function(test) {
|
|
5734
|
-
if (test.retriedTest() && test.parent) {
|
|
5708
|
+
if (test.type === 'test' && test.retriedTest() && test.parent) {
|
|
5735
5709
|
var idx =
|
|
5736
5710
|
test.parent.tests && test.parent.tests.indexOf(test.retriedTest());
|
|
5737
5711
|
if (idx > -1) test.parent.tests[idx] = test;
|
|
@@ -5867,12 +5841,8 @@ Runner.prototype.checkGlobals = function(test) {
|
|
|
5867
5841
|
this._globals = this._globals.concat(leaks);
|
|
5868
5842
|
|
|
5869
5843
|
if (leaks.length) {
|
|
5870
|
-
var
|
|
5871
|
-
|
|
5872
|
-
'global leak detected: %s',
|
|
5873
|
-
'global leaks detected: %s'
|
|
5874
|
-
);
|
|
5875
|
-
var error = new Error(util.format(format, leaks.map(sQuote).join(', ')));
|
|
5844
|
+
var msg = 'global leak(s) detected: %s';
|
|
5845
|
+
var error = new Error(util.format(msg, leaks.map(sQuote).join(', ')));
|
|
5876
5846
|
this.fail(test, error);
|
|
5877
5847
|
}
|
|
5878
5848
|
};
|
|
@@ -8189,38 +8159,6 @@ exports.dQuote = function(str) {
|
|
|
8189
8159
|
return '"' + str + '"';
|
|
8190
8160
|
};
|
|
8191
8161
|
|
|
8192
|
-
/**
|
|
8193
|
-
* Provides simplistic message translation for dealing with plurality.
|
|
8194
|
-
*
|
|
8195
|
-
* @description
|
|
8196
|
-
* Use this to create messages which need to be singular or plural.
|
|
8197
|
-
* Some languages have several plural forms, so _complete_ message clauses
|
|
8198
|
-
* are preferable to generating the message on the fly.
|
|
8199
|
-
*
|
|
8200
|
-
* @private
|
|
8201
|
-
* @param {number} n - Non-negative integer
|
|
8202
|
-
* @param {string} msg1 - Message to be used in English for `n = 1`
|
|
8203
|
-
* @param {string} msg2 - Message to be used in English for `n = 0, 2, 3, ...`
|
|
8204
|
-
* @returns {string} message corresponding to value of `n`
|
|
8205
|
-
* @example
|
|
8206
|
-
* var sprintf = require('util').format;
|
|
8207
|
-
* var pkgs = ['one', 'two'];
|
|
8208
|
-
* var msg = sprintf(
|
|
8209
|
-
* ngettext(
|
|
8210
|
-
* pkgs.length,
|
|
8211
|
-
* 'cannot load package: %s',
|
|
8212
|
-
* 'cannot load packages: %s'
|
|
8213
|
-
* ),
|
|
8214
|
-
* pkgs.map(sQuote).join(', ')
|
|
8215
|
-
* );
|
|
8216
|
-
* console.log(msg); // => cannot load packages: 'one', 'two'
|
|
8217
|
-
*/
|
|
8218
|
-
exports.ngettext = function(n, msg1, msg2) {
|
|
8219
|
-
if (typeof n === 'number' && n >= 0) {
|
|
8220
|
-
return n === 1 ? msg1 : msg2;
|
|
8221
|
-
}
|
|
8222
|
-
};
|
|
8223
|
-
|
|
8224
8162
|
/**
|
|
8225
8163
|
* It's a noop.
|
|
8226
8164
|
* @public
|
|
@@ -13840,7 +13778,6 @@ module.exports = Array.isArray || function (arr) {
|
|
|
13840
13778
|
};
|
|
13841
13779
|
|
|
13842
13780
|
},{}],59:[function(require,module,exports){
|
|
13843
|
-
(function (process){
|
|
13844
13781
|
var path = require('path');
|
|
13845
13782
|
var fs = require('fs');
|
|
13846
13783
|
var _0777 = parseInt('0777', 8);
|
|
@@ -13860,7 +13797,7 @@ function mkdirP (p, opts, f, made) {
|
|
|
13860
13797
|
var xfs = opts.fs || fs;
|
|
13861
13798
|
|
|
13862
13799
|
if (mode === undefined) {
|
|
13863
|
-
mode = _0777
|
|
13800
|
+
mode = _0777
|
|
13864
13801
|
}
|
|
13865
13802
|
if (!made) made = null;
|
|
13866
13803
|
|
|
@@ -13874,6 +13811,7 @@ function mkdirP (p, opts, f, made) {
|
|
|
13874
13811
|
}
|
|
13875
13812
|
switch (er.code) {
|
|
13876
13813
|
case 'ENOENT':
|
|
13814
|
+
if (path.dirname(p) === p) return cb(er);
|
|
13877
13815
|
mkdirP(path.dirname(p), opts, function (er, made) {
|
|
13878
13816
|
if (er) cb(er, made);
|
|
13879
13817
|
else mkdirP(p, opts, cb, made);
|
|
@@ -13904,7 +13842,7 @@ mkdirP.sync = function sync (p, opts, made) {
|
|
|
13904
13842
|
var xfs = opts.fs || fs;
|
|
13905
13843
|
|
|
13906
13844
|
if (mode === undefined) {
|
|
13907
|
-
mode = _0777
|
|
13845
|
+
mode = _0777
|
|
13908
13846
|
}
|
|
13909
13847
|
if (!made) made = null;
|
|
13910
13848
|
|
|
@@ -13940,8 +13878,7 @@ mkdirP.sync = function sync (p, opts, made) {
|
|
|
13940
13878
|
return made;
|
|
13941
13879
|
};
|
|
13942
13880
|
|
|
13943
|
-
}
|
|
13944
|
-
},{"_process":69,"fs":42,"path":42}],60:[function(require,module,exports){
|
|
13881
|
+
},{"fs":42,"path":42}],60:[function(require,module,exports){
|
|
13945
13882
|
/**
|
|
13946
13883
|
* Helpers.
|
|
13947
13884
|
*/
|
|
@@ -18171,7 +18108,7 @@ function hasOwnProperty(obj, prop) {
|
|
|
18171
18108
|
},{"./support/isBuffer":88,"_process":69,"inherits":56}],90:[function(require,module,exports){
|
|
18172
18109
|
module.exports={
|
|
18173
18110
|
"name": "mocha",
|
|
18174
|
-
"version": "7.1.
|
|
18111
|
+
"version": "7.1.2",
|
|
18175
18112
|
"homepage": "https://mochajs.org/",
|
|
18176
18113
|
"notifyLogo": "https://ibin.co/4QuRuGjXvl36.png"
|
|
18177
18114
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "simple, flexible, fun test framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mocha",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test": "./test"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">= 8.
|
|
37
|
+
"node": ">= 8.10.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"prepublishOnly": "nps test clean build",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"js-yaml": "3.13.1",
|
|
57
57
|
"log-symbols": "3.0.0",
|
|
58
58
|
"minimatch": "3.0.4",
|
|
59
|
-
"mkdirp": "0.5.
|
|
59
|
+
"mkdirp": "0.5.5",
|
|
60
60
|
"ms": "2.1.1",
|
|
61
61
|
"node-environment-flags": "1.0.6",
|
|
62
62
|
"object.assign": "4.1.0",
|