mocha 3.5.3 → 5.0.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 +1040 -959
- package/CHANGELOG.md.orig +1736 -0
- package/README.md +81 -85
- package/README.md.orig +132 -0
- package/bin/.eslintrc.yml +3 -0
- package/bin/_mocha +173 -153
- package/bin/mocha +12 -10
- package/bin/options.js +8 -6
- package/browser-entry.js +3 -3
- package/lib/browser/{.eslintrc.yaml → .eslintrc.yml} +0 -0
- package/lib/browser/growl.js +5 -0
- package/lib/context.js +10 -23
- package/lib/interfaces/bdd.js +1 -1
- package/lib/interfaces/common.js +0 -3
- package/lib/mocha.js +23 -1
- package/lib/ms.js +4 -44
- package/lib/reporters/base.js +41 -45
- package/lib/reporters/base.js.orig +498 -0
- package/lib/reporters/json-stream.js +0 -1
- package/lib/reporters/progress.js +7 -5
- package/lib/reporters/xunit.js +21 -6
- package/lib/runnable.js +17 -11
- package/lib/runner.js +42 -31
- package/lib/suite.js +25 -13
- package/lib/test.js +3 -5
- package/lib/utils.js +19 -198
- package/mocha.js +3268 -4599
- package/package.json +32 -34
- package/bower.json +0 -38
- package/lib/browser/debug.js +0 -7
- package/lib/browser/events.js +0 -195
- package/lib/to-iso-string/LICENSE +0 -19
- package/lib/to-iso-string/index.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "simple, flexible, fun test framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mocha",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"amsul (https://github.com/amsul)",
|
|
25
25
|
"Andreas Brekken <andreas@brekken.com> (https://github.com/abrkn)",
|
|
26
26
|
"Andreas Lind <andreas@one.com> (https://github.com/papandreou)",
|
|
27
|
+
"Andrew Krawchyk <akrawchyk@gmail.com> (https://github.com/akrawchyk)",
|
|
27
28
|
"Andrew Miller <vnikitin@live.com> (https://github.com/vnikiti)",
|
|
28
29
|
"Andrew Nesbitt <andrewnez@gmail.com> (https://github.com/andrew)",
|
|
29
30
|
"Andrey Popp <8mayday@gmail.com> (https://github.com/andreypopp)",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"Cory Thomas (https://github.com/dump247)",
|
|
65
66
|
"cybertk (https://github.com/cybertk)",
|
|
66
67
|
"Daniel Ericsson (https://github.com/monowerker)",
|
|
68
|
+
"Daniel Ruf (https://github.com/danielruf)",
|
|
67
69
|
"Daniel St. Jules <danielst.jules@gmail.com> (https://github.com/danielstjules)",
|
|
68
70
|
"Daniel Stockman <daniel.stockman@gmail.com> (https://github.com/evocateur)",
|
|
69
71
|
"Dave McKenna <davemckenna01@gmail.com> (https://github.com/davemckenna01)",
|
|
@@ -198,6 +200,7 @@
|
|
|
198
200
|
"Nathan Houle <nathan+github@nathanhoule.com> (https://github.com/ndhoule)",
|
|
199
201
|
"Nathan Rajlich <nathan@tootallnate.net> (https://github.com/TooTallNate)",
|
|
200
202
|
"Nick Fitzgerald (https://github.com/fitzgen)",
|
|
203
|
+
"Nikolaos Georgiou (https://github.com/ngeor)",
|
|
201
204
|
"noirlab (https://github.com/noirlab)",
|
|
202
205
|
"Noshir Patel <nosh@blackpiano.com> (https://github.com/noshir-patel)",
|
|
203
206
|
"OlegTsyba <oleg.tsyba.ua@gmail.com> (https://github.com/OlegTsyba)",
|
|
@@ -295,55 +298,53 @@
|
|
|
295
298
|
"_mocha": "./bin/_mocha"
|
|
296
299
|
},
|
|
297
300
|
"engines": {
|
|
298
|
-
"node": ">= 0.
|
|
299
|
-
"npm": ">= 1.4.x"
|
|
301
|
+
"node": ">= 4.0.0"
|
|
300
302
|
},
|
|
301
303
|
"scripts": {
|
|
302
|
-
"
|
|
303
|
-
"
|
|
304
|
-
"
|
|
305
|
-
"coveralls": "nyc report --reporter=text-lcov | coveralls"
|
|
304
|
+
"prepublishOnly": "nps test clean build",
|
|
305
|
+
"start": "nps",
|
|
306
|
+
"test": "nps test"
|
|
306
307
|
},
|
|
307
308
|
"dependencies": {
|
|
308
309
|
"browser-stdout": "1.3.0",
|
|
309
|
-
"commander": "2.
|
|
310
|
-
"debug": "
|
|
311
|
-
"diff": "3.
|
|
310
|
+
"commander": "2.11.0",
|
|
311
|
+
"debug": "3.1.0",
|
|
312
|
+
"diff": "3.3.1",
|
|
312
313
|
"escape-string-regexp": "1.0.5",
|
|
313
|
-
"glob": "7.1.
|
|
314
|
-
"growl": "1.
|
|
314
|
+
"glob": "7.1.2",
|
|
315
|
+
"growl": "1.10.3",
|
|
315
316
|
"he": "1.1.1",
|
|
316
|
-
"json3": "3.3.2",
|
|
317
|
-
"lodash.create": "3.1.1",
|
|
318
317
|
"mkdirp": "0.5.1",
|
|
319
|
-
"supports-color": "
|
|
318
|
+
"supports-color": "4.4.0"
|
|
320
319
|
},
|
|
321
320
|
"devDependencies": {
|
|
322
|
-
"@coderbyheart/karma-sauce-launcher": "git://github.com/coderbyheart/karma-sauce-launcher#5259942cd6d40090eaa13ceeef5b0b8738c7710f",
|
|
323
321
|
"assert": "^1.4.1",
|
|
324
|
-
"
|
|
322
|
+
"assetgraph-builder": "^5.6.4",
|
|
323
|
+
"browserify": "^14.4.0",
|
|
325
324
|
"coffee-script": "^1.10.0",
|
|
326
|
-
"coveralls": "^
|
|
325
|
+
"coveralls": "^3.0.0",
|
|
327
326
|
"cross-spawn": "^5.1.0",
|
|
328
|
-
"eslint": "^
|
|
329
|
-
"eslint-config-semistandard": "^
|
|
330
|
-
"eslint-config-standard": "^
|
|
327
|
+
"eslint": "^4.8.0",
|
|
328
|
+
"eslint-config-semistandard": "^11.0.0",
|
|
329
|
+
"eslint-config-standard": "^10.2.1",
|
|
330
|
+
"eslint-plugin-import": "^2.7.0",
|
|
331
|
+
"eslint-plugin-node": "^5.2.0",
|
|
331
332
|
"eslint-plugin-promise": "^3.4.0",
|
|
332
|
-
"eslint-plugin-standard": "
|
|
333
|
+
"eslint-plugin-standard": "^3.0.1",
|
|
333
334
|
"expect.js": "^0.3.1",
|
|
334
|
-
"karma": "1.
|
|
335
|
+
"karma": "^1.7.1",
|
|
335
336
|
"karma-browserify": "^5.0.5",
|
|
336
337
|
"karma-chrome-launcher": "^2.0.0",
|
|
337
338
|
"karma-expect": "^1.1.2",
|
|
338
339
|
"karma-mocha": "^1.3.0",
|
|
339
|
-
"karma-
|
|
340
|
-
"karma-
|
|
340
|
+
"karma-mocha-reporter": "^2.2.4",
|
|
341
|
+
"karma-sauce-launcher": "^1.2.0",
|
|
342
|
+
"markdown-toc": "^1.2.0",
|
|
343
|
+
"markdownlint-cli": "^0.6.0",
|
|
344
|
+
"nps": "^5.7.1",
|
|
341
345
|
"nyc": "^11.2.1",
|
|
342
|
-
"os-name": "^2.0.1",
|
|
343
|
-
"phantomjs": "1.9.8",
|
|
344
|
-
"readable-stream": "2.2.11",
|
|
345
346
|
"rimraf": "^2.5.2",
|
|
346
|
-
"
|
|
347
|
+
"svgo": "^0.7.2",
|
|
347
348
|
"through2": "^2.0.1",
|
|
348
349
|
"watchify": "^3.7.0"
|
|
349
350
|
},
|
|
@@ -354,13 +355,10 @@
|
|
|
354
355
|
"index.js",
|
|
355
356
|
"mocha.css",
|
|
356
357
|
"mocha.js",
|
|
357
|
-
"browser-entry.js"
|
|
358
|
-
"LICENSE",
|
|
359
|
-
"bower.json"
|
|
358
|
+
"browser-entry.js"
|
|
360
359
|
],
|
|
361
360
|
"browser": {
|
|
362
|
-
"
|
|
363
|
-
"events": "./lib/browser/events.js",
|
|
361
|
+
"growl": "./lib/browser/growl.js",
|
|
364
362
|
"tty": "./lib/browser/tty.js",
|
|
365
363
|
"./index.js": "./browser-entry.js",
|
|
366
364
|
"fs": false,
|
package/bower.json
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mocha",
|
|
3
|
-
"homepage": "https://mochajs.org",
|
|
4
|
-
"description": "simple, flexible, fun test framework",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git://github.com/mochajs/mocha.git"
|
|
8
|
-
},
|
|
9
|
-
"main": [
|
|
10
|
-
"mocha.js",
|
|
11
|
-
"mocha.css"
|
|
12
|
-
],
|
|
13
|
-
"ignore": [
|
|
14
|
-
"bin",
|
|
15
|
-
"editors",
|
|
16
|
-
"images",
|
|
17
|
-
"lib",
|
|
18
|
-
"scripts",
|
|
19
|
-
"test",
|
|
20
|
-
"assets",
|
|
21
|
-
"media",
|
|
22
|
-
".*",
|
|
23
|
-
"index.js",
|
|
24
|
-
"karma.conf.js",
|
|
25
|
-
"browser-entry.js",
|
|
26
|
-
"Makefile",
|
|
27
|
-
"package.json",
|
|
28
|
-
"appveyor.yml"
|
|
29
|
-
],
|
|
30
|
-
"keywords": [
|
|
31
|
-
"mocha",
|
|
32
|
-
"test",
|
|
33
|
-
"bdd",
|
|
34
|
-
"tdd",
|
|
35
|
-
"tap"
|
|
36
|
-
],
|
|
37
|
-
"license": "MIT"
|
|
38
|
-
}
|
package/lib/browser/debug.js
DELETED
package/lib/browser/events.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Module exports.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
exports.EventEmitter = EventEmitter;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Object#toString reference.
|
|
11
|
-
*/
|
|
12
|
-
var objToString = Object.prototype.toString;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Check if a value is an array.
|
|
16
|
-
*
|
|
17
|
-
* @api private
|
|
18
|
-
* @param {*} val The value to test.
|
|
19
|
-
* @return {boolean} true if the value is an array, otherwise false.
|
|
20
|
-
*/
|
|
21
|
-
function isArray (val) {
|
|
22
|
-
return objToString.call(val) === '[object Array]';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Event emitter constructor.
|
|
27
|
-
*
|
|
28
|
-
* @api public
|
|
29
|
-
*/
|
|
30
|
-
function EventEmitter () {}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Add a listener.
|
|
34
|
-
*
|
|
35
|
-
* @api public
|
|
36
|
-
* @param {string} name Event name.
|
|
37
|
-
* @param {Function} fn Event handler.
|
|
38
|
-
* @return {EventEmitter} Emitter instance.
|
|
39
|
-
*/
|
|
40
|
-
EventEmitter.prototype.on = function (name, fn) {
|
|
41
|
-
if (!this.$events) {
|
|
42
|
-
this.$events = {};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!this.$events[name]) {
|
|
46
|
-
this.$events[name] = fn;
|
|
47
|
-
} else if (isArray(this.$events[name])) {
|
|
48
|
-
this.$events[name].push(fn);
|
|
49
|
-
} else {
|
|
50
|
-
this.$events[name] = [this.$events[name], fn];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return this;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Adds a volatile listener.
|
|
60
|
-
*
|
|
61
|
-
* @api public
|
|
62
|
-
* @param {string} name Event name.
|
|
63
|
-
* @param {Function} fn Event handler.
|
|
64
|
-
* @return {EventEmitter} Emitter instance.
|
|
65
|
-
*/
|
|
66
|
-
EventEmitter.prototype.once = function (name, fn) {
|
|
67
|
-
var self = this;
|
|
68
|
-
|
|
69
|
-
function on () {
|
|
70
|
-
self.removeListener(name, on);
|
|
71
|
-
fn.apply(this, arguments);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
on.listener = fn;
|
|
75
|
-
this.on(name, on);
|
|
76
|
-
|
|
77
|
-
return this;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Remove a listener.
|
|
82
|
-
*
|
|
83
|
-
* @api public
|
|
84
|
-
* @param {string} name Event name.
|
|
85
|
-
* @param {Function} fn Event handler.
|
|
86
|
-
* @return {EventEmitter} Emitter instance.
|
|
87
|
-
*/
|
|
88
|
-
EventEmitter.prototype.removeListener = function (name, fn) {
|
|
89
|
-
if (this.$events && this.$events[name]) {
|
|
90
|
-
var list = this.$events[name];
|
|
91
|
-
|
|
92
|
-
if (isArray(list)) {
|
|
93
|
-
var pos = -1;
|
|
94
|
-
|
|
95
|
-
for (var i = 0, l = list.length; i < l; i++) {
|
|
96
|
-
if (list[i] === fn || (list[i].listener && list[i].listener === fn)) {
|
|
97
|
-
pos = i;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (pos < 0) {
|
|
103
|
-
return this;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
list.splice(pos, 1);
|
|
107
|
-
|
|
108
|
-
if (!list.length) {
|
|
109
|
-
delete this.$events[name];
|
|
110
|
-
}
|
|
111
|
-
} else if (list === fn || (list.listener && list.listener === fn)) {
|
|
112
|
-
delete this.$events[name];
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return this;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Remove all listeners for an event.
|
|
121
|
-
*
|
|
122
|
-
* @api public
|
|
123
|
-
* @param {string} name Event name.
|
|
124
|
-
* @return {EventEmitter} Emitter instance.
|
|
125
|
-
*/
|
|
126
|
-
EventEmitter.prototype.removeAllListeners = function (name) {
|
|
127
|
-
if (name === undefined) {
|
|
128
|
-
this.$events = {};
|
|
129
|
-
return this;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (this.$events && this.$events[name]) {
|
|
133
|
-
this.$events[name] = null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return this;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Get all listeners for a given event.
|
|
141
|
-
*
|
|
142
|
-
* @api public
|
|
143
|
-
* @param {string} name Event name.
|
|
144
|
-
* @return {EventEmitter} Emitter instance.
|
|
145
|
-
*/
|
|
146
|
-
EventEmitter.prototype.listeners = function (name) {
|
|
147
|
-
if (!this.$events) {
|
|
148
|
-
this.$events = {};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (!this.$events[name]) {
|
|
152
|
-
this.$events[name] = [];
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (!isArray(this.$events[name])) {
|
|
156
|
-
this.$events[name] = [this.$events[name]];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return this.$events[name];
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Emit an event.
|
|
164
|
-
*
|
|
165
|
-
* @api public
|
|
166
|
-
* @param {string} name Event name.
|
|
167
|
-
* @return {boolean} true if at least one handler was invoked, else false.
|
|
168
|
-
*/
|
|
169
|
-
EventEmitter.prototype.emit = function (name) {
|
|
170
|
-
if (!this.$events) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
var handler = this.$events[name];
|
|
175
|
-
|
|
176
|
-
if (!handler) {
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
181
|
-
|
|
182
|
-
if (typeof handler === 'function') {
|
|
183
|
-
handler.apply(this, args);
|
|
184
|
-
} else if (isArray(handler)) {
|
|
185
|
-
var listeners = handler.slice();
|
|
186
|
-
|
|
187
|
-
for (var i = 0, l = listeners.length; i < l; i++) {
|
|
188
|
-
listeners[i].apply(this, args);
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return true;
|
|
195
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2016 Segment.io, Inc. (friends@segment.com)
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
|
11
|
-
all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
THE SOFTWARE.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Pad a `number` with a ten's place zero.
|
|
5
|
-
*
|
|
6
|
-
* @param {number} number
|
|
7
|
-
* @return {string}
|
|
8
|
-
*/
|
|
9
|
-
function pad(number) {
|
|
10
|
-
var n = number.toString();
|
|
11
|
-
return n.length === 1 ? '0' + n : n;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Turn a `date` into an ISO string.
|
|
16
|
-
*
|
|
17
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
|
|
18
|
-
*
|
|
19
|
-
* @param {Date} date
|
|
20
|
-
* @return {string}
|
|
21
|
-
*/
|
|
22
|
-
function toISOString(date) {
|
|
23
|
-
return date.getUTCFullYear()
|
|
24
|
-
+ '-' + pad(date.getUTCMonth() + 1)
|
|
25
|
-
+ '-' + pad(date.getUTCDate())
|
|
26
|
-
+ 'T' + pad(date.getUTCHours())
|
|
27
|
-
+ ':' + pad(date.getUTCMinutes())
|
|
28
|
-
+ ':' + pad(date.getUTCSeconds())
|
|
29
|
-
+ '.' + String((date.getUTCMilliseconds()/1000).toFixed(3)).slice(2, 5)
|
|
30
|
-
+ 'Z';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
* Exports.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
module.exports = toISOString;
|