mocha 11.2.0 → 11.2.1
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/lib/cli/cli.js +6 -6
- package/lib/cli/collect-files.js +3 -3
- package/lib/cli/options.js +2 -2
- package/lib/cli/run-helpers.js +2 -2
- package/lib/cli/run.js +2 -2
- package/mocha.js +2 -2
- package/package.json +2 -2
package/lib/cli/cli.js
CHANGED
|
@@ -20,7 +20,7 @@ const {
|
|
|
20
20
|
} = require('./options');
|
|
21
21
|
const lookupFiles = require('./lookup-files');
|
|
22
22
|
const commands = require('./commands');
|
|
23
|
-
const
|
|
23
|
+
const pc = require('picocolors');
|
|
24
24
|
const {repository, homepage, version, discord} = require('../../package.json');
|
|
25
25
|
const {cwd} = require('../utils');
|
|
26
26
|
|
|
@@ -60,7 +60,7 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => {
|
|
|
60
60
|
.fail((msg, err, yargs) => {
|
|
61
61
|
debug('caught error sometime before command handler: %O', err);
|
|
62
62
|
yargs.showHelp();
|
|
63
|
-
console.error(`\n${symbols.error} ${
|
|
63
|
+
console.error(`\n${symbols.error} ${pc.red('ERROR:')} ${msg}`);
|
|
64
64
|
process.exit(1);
|
|
65
65
|
})
|
|
66
66
|
.help('help', 'Show usage information & exit')
|
|
@@ -69,10 +69,10 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => {
|
|
|
69
69
|
.alias('version', 'V')
|
|
70
70
|
.wrap(process.stdout.columns ? Math.min(process.stdout.columns, 80) : 80)
|
|
71
71
|
.epilog(
|
|
72
|
-
`${
|
|
73
|
-
Chat: ${
|
|
74
|
-
GitHub: ${
|
|
75
|
-
Docs: ${
|
|
72
|
+
`${pc.reset("Mocha Resources")}
|
|
73
|
+
Chat: ${pc.magenta(discord)}
|
|
74
|
+
GitHub: ${pc.blue(repository.url)}
|
|
75
|
+
Docs: ${pc.yellow(homepage)}
|
|
76
76
|
`
|
|
77
77
|
)
|
|
78
78
|
.parserConfiguration(YARGS_PARSER_CONFIG)
|
package/lib/cli/collect-files.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('node:fs');
|
|
4
4
|
const path = require('node:path');
|
|
5
|
-
const
|
|
5
|
+
const pc = require('picocolors');
|
|
6
6
|
const debug = require('debug')('mocha:cli:run:helpers');
|
|
7
7
|
const minimatch = require('minimatch');
|
|
8
8
|
const {NO_FILES_MATCH_PATTERN} = require('../errors').constants;
|
|
@@ -94,12 +94,12 @@ module.exports = ({
|
|
|
94
94
|
unmatchedSpecFiles[0].pattern
|
|
95
95
|
)}` // stringify to print escaped characters raw
|
|
96
96
|
: 'Error: No test files found';
|
|
97
|
-
console.error(
|
|
97
|
+
console.error(pc.red(noneFoundMsg));
|
|
98
98
|
process.exit(1);
|
|
99
99
|
} else {
|
|
100
100
|
// print messages as a warning
|
|
101
101
|
unmatchedSpecFiles.forEach(warning => {
|
|
102
|
-
console.warn(
|
|
102
|
+
console.warn(pc.yellow(`Warning: ${warning.message}`));
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
|
package/lib/cli/options.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
const fs = require('node:fs');
|
|
11
|
-
const
|
|
11
|
+
const pc = require('picocolors');
|
|
12
12
|
const yargsParser = require('yargs-parser');
|
|
13
13
|
const {
|
|
14
14
|
types,
|
|
@@ -180,7 +180,7 @@ const parse = (args = [], defaultValues = {}, ...configObjects) => {
|
|
|
180
180
|
boolean: types.boolean.concat(nodeArgs.map(pair => pair[0]))
|
|
181
181
|
});
|
|
182
182
|
if (result.error) {
|
|
183
|
-
console.error(
|
|
183
|
+
console.error(pc.red(`Error: ${result.error.message}`));
|
|
184
184
|
process.exit(1);
|
|
185
185
|
}
|
|
186
186
|
|
package/lib/cli/run-helpers.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
const fs = require('node:fs');
|
|
11
11
|
const path = require('node:path');
|
|
12
|
-
const
|
|
12
|
+
const pc = require('picocolors');
|
|
13
13
|
const debug = require('debug')('mocha:cli:run:helpers');
|
|
14
14
|
const {watchRun, watchParallelRun} = require('./watch-run');
|
|
15
15
|
const collectFiles = require('./collect-files');
|
|
@@ -121,7 +121,7 @@ const handleUnmatchedFiles = (mocha, unmatchedFiles) => {
|
|
|
121
121
|
|
|
122
122
|
unmatchedFiles.forEach(({pattern, absolutePath}) => {
|
|
123
123
|
console.error(
|
|
124
|
-
|
|
124
|
+
pc.yellow(
|
|
125
125
|
`Warning: Cannot find any files matching pattern "${pattern}" at the absolute path "${absolutePath}"`
|
|
126
126
|
)
|
|
127
127
|
);
|
package/lib/cli/run.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
const symbols = require('log-symbols');
|
|
11
|
-
const
|
|
11
|
+
const pc = require('picocolors');
|
|
12
12
|
const Mocha = require('../mocha');
|
|
13
13
|
const {
|
|
14
14
|
createUnsupportedError,
|
|
@@ -357,7 +357,7 @@ exports.builder = yargs =>
|
|
|
357
357
|
Object.assign(argv, plugins);
|
|
358
358
|
} catch (err) {
|
|
359
359
|
// this could be a bad --require, bad reporter, ui, etc.
|
|
360
|
-
console.error(`\n${symbols.error} ${
|
|
360
|
+
console.error(`\n${symbols.error} ${pc.red('ERROR:')}`, err);
|
|
361
361
|
yargs.exit(1);
|
|
362
362
|
}
|
|
363
363
|
})
|
package/mocha.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// mocha@11.2.
|
|
1
|
+
// mocha@11.2.1 in javascript ES2018
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -19256,7 +19256,7 @@
|
|
|
19256
19256
|
};
|
|
19257
19257
|
|
|
19258
19258
|
var name = "mocha";
|
|
19259
|
-
var version = "11.2.
|
|
19259
|
+
var version = "11.2.1";
|
|
19260
19260
|
var homepage = "https://mochajs.org/";
|
|
19261
19261
|
var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
|
|
19262
19262
|
var require$$17 = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "simple, flexible, fun test framework",
|
|
6
6
|
"keywords": [
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"version": "run-p version:* && git add -A ./AUTHORS ./CHANGELOG.md"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"ansi-colors": "^4.1.3",
|
|
98
97
|
"browser-stdout": "^1.3.1",
|
|
99
98
|
"chokidar": "^3.5.3",
|
|
100
99
|
"debug": "^4.3.5",
|
|
@@ -107,6 +106,7 @@
|
|
|
107
106
|
"log-symbols": "^4.1.0",
|
|
108
107
|
"minimatch": "^5.1.6",
|
|
109
108
|
"ms": "^2.1.3",
|
|
109
|
+
"picocolors": "^1.1.1",
|
|
110
110
|
"serialize-javascript": "^6.0.2",
|
|
111
111
|
"strip-json-comments": "^3.1.1",
|
|
112
112
|
"supports-color": "^8.1.1",
|