mocha 10.4.0 → 10.5.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/README.md +7 -7
- package/browser-entry.js +2 -2
- package/lib/cli/options.js +13 -4
- package/lib/nodejs/reporters/parallel-buffered.js +1 -1
- package/lib/nodejs/serializer.js +1 -1
- package/lib/reporters/html.js +27 -22
- package/mocha.css +54 -17
- package/mocha.js +30 -163
- package/mocha.js.map +1 -1
- package/package.json +2 -8
- package/lib/browser/progress.js +0 -138
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "simple, flexible, fun test framework",
|
|
6
6
|
"keywords": [
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"ansi-colors": "4.1.1",
|
|
55
55
|
"browser-stdout": "1.3.1",
|
|
56
|
-
"chokidar": "3.5.3",
|
|
56
|
+
"chokidar": "^3.5.3",
|
|
57
57
|
"debug": "4.3.4",
|
|
58
58
|
"diff": "5.0.0",
|
|
59
59
|
"escape-string-regexp": "4.0.0",
|
|
@@ -92,7 +92,6 @@
|
|
|
92
92
|
"fail-on-errors-webpack-plugin": "^3.0.0",
|
|
93
93
|
"fs-extra": "^10.0.0",
|
|
94
94
|
"globals": "^13.24.0",
|
|
95
|
-
"husky": "^4.2.5",
|
|
96
95
|
"hyperlink": "^5.0.4",
|
|
97
96
|
"jsdoc": "^3.6.7",
|
|
98
97
|
"jsdoc-ts-utils": "^2.0.1",
|
|
@@ -168,10 +167,5 @@
|
|
|
168
167
|
},
|
|
169
168
|
"overrides": {
|
|
170
169
|
"webdriverio": "^7.33.0"
|
|
171
|
-
},
|
|
172
|
-
"husky": {
|
|
173
|
-
"hooks": {
|
|
174
|
-
"pre-commit": "lint-staged"
|
|
175
|
-
}
|
|
176
170
|
}
|
|
177
171
|
}
|
package/lib/browser/progress.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
@module browser/Progress
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Expose `Progress`.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
module.exports = Progress;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Initialize a new `Progress` indicator.
|
|
15
|
-
*/
|
|
16
|
-
function Progress() {
|
|
17
|
-
this.percent = 0;
|
|
18
|
-
this.size(0);
|
|
19
|
-
this.fontSize(11);
|
|
20
|
-
this.font('helvetica, arial, sans-serif');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Set progress size to `size`.
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
* @param {number} size
|
|
28
|
-
* @return {Progress} Progress instance.
|
|
29
|
-
*/
|
|
30
|
-
Progress.prototype.size = function (size) {
|
|
31
|
-
this._size = size;
|
|
32
|
-
return this;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Set text to `text`.
|
|
37
|
-
*
|
|
38
|
-
* @public
|
|
39
|
-
* @param {string} text
|
|
40
|
-
* @return {Progress} Progress instance.
|
|
41
|
-
*/
|
|
42
|
-
Progress.prototype.text = function (text) {
|
|
43
|
-
this._text = text;
|
|
44
|
-
return this;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Set font size to `size`.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
* @param {number} size
|
|
52
|
-
* @return {Progress} Progress instance.
|
|
53
|
-
*/
|
|
54
|
-
Progress.prototype.fontSize = function (size) {
|
|
55
|
-
this._fontSize = size;
|
|
56
|
-
return this;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Set font to `family`.
|
|
61
|
-
*
|
|
62
|
-
* @param {string} family
|
|
63
|
-
* @return {Progress} Progress instance.
|
|
64
|
-
*/
|
|
65
|
-
Progress.prototype.font = function (family) {
|
|
66
|
-
this._font = family;
|
|
67
|
-
return this;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Update percentage to `n`.
|
|
72
|
-
*
|
|
73
|
-
* @param {number} n
|
|
74
|
-
* @return {Progress} Progress instance.
|
|
75
|
-
*/
|
|
76
|
-
Progress.prototype.update = function (n) {
|
|
77
|
-
this.percent = n;
|
|
78
|
-
return this;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Draw on `ctx`.
|
|
83
|
-
*
|
|
84
|
-
* @param {CanvasRenderingContext2d} ctx
|
|
85
|
-
* @return {Progress} Progress instance.
|
|
86
|
-
*/
|
|
87
|
-
Progress.prototype.draw = function (ctx) {
|
|
88
|
-
try {
|
|
89
|
-
var darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');
|
|
90
|
-
var isDarkMode = !!darkMatcher.matches;
|
|
91
|
-
var lightColors = {
|
|
92
|
-
outerCircle: '#9f9f9f',
|
|
93
|
-
innerCircle: '#eee',
|
|
94
|
-
text: '#000'
|
|
95
|
-
};
|
|
96
|
-
var darkColors = {
|
|
97
|
-
outerCircle: '#888',
|
|
98
|
-
innerCircle: '#444',
|
|
99
|
-
text: '#fff'
|
|
100
|
-
};
|
|
101
|
-
var colors = isDarkMode ? darkColors : lightColors;
|
|
102
|
-
|
|
103
|
-
var percent = Math.min(this.percent, 100);
|
|
104
|
-
var size = this._size;
|
|
105
|
-
var half = size / 2;
|
|
106
|
-
var x = half;
|
|
107
|
-
var y = half;
|
|
108
|
-
var rad = half - 1;
|
|
109
|
-
var fontSize = this._fontSize;
|
|
110
|
-
|
|
111
|
-
ctx.font = fontSize + 'px ' + this._font;
|
|
112
|
-
|
|
113
|
-
var angle = Math.PI * 2 * (percent / 100);
|
|
114
|
-
ctx.clearRect(0, 0, size, size);
|
|
115
|
-
|
|
116
|
-
// outer circle
|
|
117
|
-
ctx.strokeStyle = colors.outerCircle;
|
|
118
|
-
ctx.beginPath();
|
|
119
|
-
ctx.arc(x, y, rad, 0, angle, false);
|
|
120
|
-
ctx.stroke();
|
|
121
|
-
|
|
122
|
-
// inner circle
|
|
123
|
-
ctx.strokeStyle = colors.innerCircle;
|
|
124
|
-
ctx.beginPath();
|
|
125
|
-
ctx.arc(x, y, rad - 1, 0, angle, true);
|
|
126
|
-
ctx.stroke();
|
|
127
|
-
|
|
128
|
-
// text
|
|
129
|
-
var text = this._text || (percent | 0) + '%';
|
|
130
|
-
var w = ctx.measureText(text).width;
|
|
131
|
-
|
|
132
|
-
ctx.fillStyle = colors.text;
|
|
133
|
-
ctx.fillText(text, x - w / 2 + 1, y + fontSize / 2 - 1);
|
|
134
|
-
} catch (ignore) {
|
|
135
|
-
// don't fail if we can't render progress
|
|
136
|
-
}
|
|
137
|
-
return this;
|
|
138
|
-
};
|