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.
Files changed (61) hide show
  1. package/CHANGELOG.md +1776 -1751
  2. package/LICENSE +22 -22
  3. package/README.md +105 -105
  4. package/bin/_mocha +10 -10
  5. package/bin/mocha +149 -149
  6. package/bin/options.js +10 -10
  7. package/browser-entry.js +191 -191
  8. package/index.js +3 -3
  9. package/lib/browser/growl.js +168 -168
  10. package/lib/browser/progress.js +119 -119
  11. package/lib/browser/template.html +18 -18
  12. package/lib/browser/tty.js +13 -13
  13. package/lib/cli/cli.js +69 -69
  14. package/lib/cli/commands.js +13 -13
  15. package/lib/cli/config.js +101 -101
  16. package/lib/cli/index.js +9 -9
  17. package/lib/cli/init.js +37 -37
  18. package/lib/cli/node-flags.js +86 -86
  19. package/lib/cli/one-and-dones.js +70 -70
  20. package/lib/cli/options.js +347 -347
  21. package/lib/cli/run-helpers.js +337 -337
  22. package/lib/cli/run-option-metadata.js +76 -76
  23. package/lib/cli/run.js +297 -297
  24. package/lib/context.js +101 -101
  25. package/lib/errors.js +141 -141
  26. package/lib/growl.js +136 -136
  27. package/lib/hook.js +46 -46
  28. package/lib/interfaces/bdd.js +118 -118
  29. package/lib/interfaces/common.js +191 -191
  30. package/lib/interfaces/exports.js +60 -60
  31. package/lib/interfaces/index.js +6 -6
  32. package/lib/interfaces/qunit.js +99 -99
  33. package/lib/interfaces/tdd.js +107 -107
  34. package/lib/mocha.js +843 -843
  35. package/lib/mocharc.json +10 -10
  36. package/lib/pending.js +12 -12
  37. package/lib/reporters/base.js +491 -491
  38. package/lib/reporters/doc.js +85 -85
  39. package/lib/reporters/dot.js +81 -81
  40. package/lib/reporters/html.js +390 -390
  41. package/lib/reporters/index.js +19 -19
  42. package/lib/reporters/json-stream.js +90 -90
  43. package/lib/reporters/json.js +135 -135
  44. package/lib/reporters/landing.js +108 -108
  45. package/lib/reporters/list.js +78 -78
  46. package/lib/reporters/markdown.js +112 -112
  47. package/lib/reporters/min.js +52 -52
  48. package/lib/reporters/nyan.js +276 -276
  49. package/lib/reporters/progress.js +104 -104
  50. package/lib/reporters/spec.js +99 -99
  51. package/lib/reporters/tap.js +294 -294
  52. package/lib/reporters/xunit.js +216 -216
  53. package/lib/runnable.js +496 -496
  54. package/lib/runner.js +1049 -1049
  55. package/lib/stats-collector.js +83 -83
  56. package/lib/suite.js +642 -642
  57. package/lib/test.js +51 -51
  58. package/lib/utils.js +897 -897
  59. package/mocha.css +326 -326
  60. package/mocha.js +8170 -8476
  61. package/package.json +630 -628
@@ -1,70 +1,70 @@
1
- 'use strict';
2
-
3
- /**
4
- * Contains "command" code for "one-and-dones"--options passed
5
- * to Mocha which cause it to just dump some info and exit.
6
- * See {@link module:lib/cli/one-and-dones.ONE_AND_DONE_ARGS ONE_AND_DONE_ARGS} for more info.
7
- * @module
8
- * @private
9
- */
10
-
11
- const align = require('wide-align');
12
- const Mocha = require('../mocha');
13
-
14
- /**
15
- * Dumps a sorted list of the enumerable, lower-case keys of some object
16
- * to `STDOUT`.
17
- * @param {Object} obj - Object, ostensibly having some enumerable keys
18
- * @ignore
19
- * @private
20
- */
21
- const showKeys = obj => {
22
- console.log();
23
- const keys = Object.keys(obj);
24
- const maxKeyLength = keys.reduce((max, key) => Math.max(max, key.length), 0);
25
- keys
26
- .filter(
27
- key => /^[a-z]/.test(key) && !obj[key].browserOnly && !obj[key].abstract
28
- )
29
- .sort()
30
- .forEach(key => {
31
- const description = obj[key].description;
32
- console.log(
33
- ` ${align.left(key, maxKeyLength + 1)}${
34
- description ? `- ${description}` : ''
35
- }`
36
- );
37
- });
38
- console.log();
39
- };
40
-
41
- /**
42
- * Handlers for one-and-done options
43
- * @namespace
44
- * @private
45
- */
46
- exports.ONE_AND_DONES = {
47
- /**
48
- * Dump list of built-in interfaces
49
- * @private
50
- */
51
- interfaces: () => {
52
- showKeys(Mocha.interfaces);
53
- },
54
- /**
55
- * Dump list of built-in reporters
56
- * @private
57
- */
58
- reporters: () => {
59
- showKeys(Mocha.reporters);
60
- }
61
- };
62
-
63
- /**
64
- * A Set of all one-and-done options
65
- * @type Set<string>
66
- * @private
67
- */
68
- exports.ONE_AND_DONE_ARGS = new Set(
69
- ['help', 'h', 'version', 'V'].concat(Object.keys(exports.ONE_AND_DONES))
70
- );
1
+ 'use strict';
2
+
3
+ /**
4
+ * Contains "command" code for "one-and-dones"--options passed
5
+ * to Mocha which cause it to just dump some info and exit.
6
+ * See {@link module:lib/cli/one-and-dones.ONE_AND_DONE_ARGS ONE_AND_DONE_ARGS} for more info.
7
+ * @module
8
+ * @private
9
+ */
10
+
11
+ const align = require('wide-align');
12
+ const Mocha = require('../mocha');
13
+
14
+ /**
15
+ * Dumps a sorted list of the enumerable, lower-case keys of some object
16
+ * to `STDOUT`.
17
+ * @param {Object} obj - Object, ostensibly having some enumerable keys
18
+ * @ignore
19
+ * @private
20
+ */
21
+ const showKeys = obj => {
22
+ console.log();
23
+ const keys = Object.keys(obj);
24
+ const maxKeyLength = keys.reduce((max, key) => Math.max(max, key.length), 0);
25
+ keys
26
+ .filter(
27
+ key => /^[a-z]/.test(key) && !obj[key].browserOnly && !obj[key].abstract
28
+ )
29
+ .sort()
30
+ .forEach(key => {
31
+ const description = obj[key].description;
32
+ console.log(
33
+ ` ${align.left(key, maxKeyLength + 1)}${
34
+ description ? `- ${description}` : ''
35
+ }`
36
+ );
37
+ });
38
+ console.log();
39
+ };
40
+
41
+ /**
42
+ * Handlers for one-and-done options
43
+ * @namespace
44
+ * @private
45
+ */
46
+ exports.ONE_AND_DONES = {
47
+ /**
48
+ * Dump list of built-in interfaces
49
+ * @private
50
+ */
51
+ interfaces: () => {
52
+ showKeys(Mocha.interfaces);
53
+ },
54
+ /**
55
+ * Dump list of built-in reporters
56
+ * @private
57
+ */
58
+ reporters: () => {
59
+ showKeys(Mocha.reporters);
60
+ }
61
+ };
62
+
63
+ /**
64
+ * A Set of all one-and-done options
65
+ * @type Set<string>
66
+ * @private
67
+ */
68
+ exports.ONE_AND_DONE_ARGS = new Set(
69
+ ['help', 'h', 'version', 'V'].concat(Object.keys(exports.ONE_AND_DONES))
70
+ );