mocha 6.1.0 → 6.1.4
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 +1776 -1751
- package/LICENSE +22 -22
- package/README.md +105 -105
- package/bin/_mocha +10 -10
- package/bin/mocha +149 -149
- package/bin/options.js +10 -10
- package/browser-entry.js +191 -191
- package/index.js +3 -3
- package/lib/browser/growl.js +168 -168
- package/lib/browser/progress.js +119 -119
- package/lib/browser/template.html +18 -18
- package/lib/browser/tty.js +13 -13
- package/lib/cli/cli.js +69 -69
- package/lib/cli/commands.js +13 -13
- package/lib/cli/config.js +101 -101
- package/lib/cli/index.js +9 -9
- package/lib/cli/init.js +37 -37
- package/lib/cli/node-flags.js +86 -86
- package/lib/cli/one-and-dones.js +70 -70
- package/lib/cli/options.js +347 -347
- package/lib/cli/run-helpers.js +337 -337
- package/lib/cli/run-option-metadata.js +76 -76
- package/lib/cli/run.js +297 -297
- package/lib/context.js +101 -101
- package/lib/errors.js +141 -141
- package/lib/growl.js +136 -136
- package/lib/hook.js +46 -46
- package/lib/interfaces/bdd.js +118 -118
- package/lib/interfaces/common.js +191 -191
- package/lib/interfaces/exports.js +60 -60
- package/lib/interfaces/index.js +6 -6
- package/lib/interfaces/qunit.js +99 -99
- package/lib/interfaces/tdd.js +107 -107
- package/lib/mocha.js +843 -843
- package/lib/mocharc.json +10 -10
- package/lib/pending.js +12 -12
- package/lib/reporters/base.js +491 -491
- package/lib/reporters/doc.js +85 -85
- package/lib/reporters/dot.js +81 -81
- package/lib/reporters/html.js +390 -390
- package/lib/reporters/index.js +19 -19
- package/lib/reporters/json-stream.js +90 -90
- package/lib/reporters/json.js +135 -135
- package/lib/reporters/landing.js +108 -108
- package/lib/reporters/list.js +78 -78
- package/lib/reporters/markdown.js +112 -112
- package/lib/reporters/min.js +52 -52
- package/lib/reporters/nyan.js +276 -276
- package/lib/reporters/progress.js +104 -104
- package/lib/reporters/spec.js +99 -99
- package/lib/reporters/tap.js +294 -294
- package/lib/reporters/xunit.js +216 -216
- package/lib/runnable.js +496 -496
- package/lib/runner.js +1049 -1049
- package/lib/stats-collector.js +83 -83
- package/lib/suite.js +642 -642
- package/lib/test.js +51 -51
- package/lib/utils.js +897 -897
- package/mocha.css +326 -326
- package/mocha.js +8170 -8476
- package/package.json +630 -628
package/lib/test.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var Runnable = require('./runnable');
|
|
3
|
-
var utils = require('./utils');
|
|
4
|
-
var errors = require('./errors');
|
|
5
|
-
var createInvalidArgumentTypeError = errors.createInvalidArgumentTypeError;
|
|
6
|
-
var isString = utils.isString;
|
|
7
|
-
|
|
8
|
-
module.exports = Test;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Initialize a new `Test` with the given `title` and callback `fn`.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
* @class
|
|
15
|
-
* @extends Runnable
|
|
16
|
-
* @param {String} title - Test title (required)
|
|
17
|
-
* @param {Function} [fn] - Test callback. If omitted, the Test is considered "pending"
|
|
18
|
-
*/
|
|
19
|
-
function Test(title, fn) {
|
|
20
|
-
if (!isString(title)) {
|
|
21
|
-
throw createInvalidArgumentTypeError(
|
|
22
|
-
'Test argument "title" should be a string. Received type "' +
|
|
23
|
-
typeof title +
|
|
24
|
-
'"',
|
|
25
|
-
'title',
|
|
26
|
-
'string'
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
Runnable.call(this, title, fn);
|
|
30
|
-
this.pending = !fn;
|
|
31
|
-
this.type = 'test';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Inherit from `Runnable.prototype`.
|
|
36
|
-
*/
|
|
37
|
-
utils.inherits(Test, Runnable);
|
|
38
|
-
|
|
39
|
-
Test.prototype.clone = function() {
|
|
40
|
-
var test = new Test(this.title, this.fn);
|
|
41
|
-
test.timeout(this.timeout());
|
|
42
|
-
test.slow(this.slow());
|
|
43
|
-
test.enableTimeouts(this.enableTimeouts());
|
|
44
|
-
test.retries(this.retries());
|
|
45
|
-
test.currentRetry(this.currentRetry());
|
|
46
|
-
test.globals(this.globals());
|
|
47
|
-
test.parent = this.parent;
|
|
48
|
-
test.file = this.file;
|
|
49
|
-
test.ctx = this.ctx;
|
|
50
|
-
return test;
|
|
51
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
var Runnable = require('./runnable');
|
|
3
|
+
var utils = require('./utils');
|
|
4
|
+
var errors = require('./errors');
|
|
5
|
+
var createInvalidArgumentTypeError = errors.createInvalidArgumentTypeError;
|
|
6
|
+
var isString = utils.isString;
|
|
7
|
+
|
|
8
|
+
module.exports = Test;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Initialize a new `Test` with the given `title` and callback `fn`.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
* @class
|
|
15
|
+
* @extends Runnable
|
|
16
|
+
* @param {String} title - Test title (required)
|
|
17
|
+
* @param {Function} [fn] - Test callback. If omitted, the Test is considered "pending"
|
|
18
|
+
*/
|
|
19
|
+
function Test(title, fn) {
|
|
20
|
+
if (!isString(title)) {
|
|
21
|
+
throw createInvalidArgumentTypeError(
|
|
22
|
+
'Test argument "title" should be a string. Received type "' +
|
|
23
|
+
typeof title +
|
|
24
|
+
'"',
|
|
25
|
+
'title',
|
|
26
|
+
'string'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
Runnable.call(this, title, fn);
|
|
30
|
+
this.pending = !fn;
|
|
31
|
+
this.type = 'test';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Inherit from `Runnable.prototype`.
|
|
36
|
+
*/
|
|
37
|
+
utils.inherits(Test, Runnable);
|
|
38
|
+
|
|
39
|
+
Test.prototype.clone = function() {
|
|
40
|
+
var test = new Test(this.title, this.fn);
|
|
41
|
+
test.timeout(this.timeout());
|
|
42
|
+
test.slow(this.slow());
|
|
43
|
+
test.enableTimeouts(this.enableTimeouts());
|
|
44
|
+
test.retries(this.retries());
|
|
45
|
+
test.currentRetry(this.currentRetry());
|
|
46
|
+
test.globals(this.globals());
|
|
47
|
+
test.parent = this.parent;
|
|
48
|
+
test.file = this.file;
|
|
49
|
+
test.ctx = this.ctx;
|
|
50
|
+
return test;
|
|
51
|
+
};
|