mocha 10.0.0 → 10.1.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/lib/browser/progress.js +17 -2
- package/lib/interfaces/bdd.js +9 -9
- package/lib/interfaces/qunit.js +4 -4
- package/lib/interfaces/tdd.js +9 -9
- package/lib/nodejs/parallel-buffered-runner.js +1 -2
- package/lib/reporters/json-stream.js +1 -1
- package/lib/reporters/markdown.js +1 -1
- package/lib/utils.js +1 -1
- package/mocha.css +103 -36
- package/mocha.js +44 -29
- package/mocha.js.map +1 -1
- package/package.json +7 -8
package/lib/browser/progress.js
CHANGED
|
@@ -86,6 +86,20 @@ Progress.prototype.update = function (n) {
|
|
|
86
86
|
*/
|
|
87
87
|
Progress.prototype.draw = function (ctx) {
|
|
88
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
|
+
|
|
89
103
|
var percent = Math.min(this.percent, 100);
|
|
90
104
|
var size = this._size;
|
|
91
105
|
var half = size / 2;
|
|
@@ -100,13 +114,13 @@ Progress.prototype.draw = function (ctx) {
|
|
|
100
114
|
ctx.clearRect(0, 0, size, size);
|
|
101
115
|
|
|
102
116
|
// outer circle
|
|
103
|
-
ctx.strokeStyle =
|
|
117
|
+
ctx.strokeStyle = colors.outerCircle;
|
|
104
118
|
ctx.beginPath();
|
|
105
119
|
ctx.arc(x, y, rad, 0, angle, false);
|
|
106
120
|
ctx.stroke();
|
|
107
121
|
|
|
108
122
|
// inner circle
|
|
109
|
-
ctx.strokeStyle =
|
|
123
|
+
ctx.strokeStyle = colors.innerCircle;
|
|
110
124
|
ctx.beginPath();
|
|
111
125
|
ctx.arc(x, y, rad - 1, 0, angle, true);
|
|
112
126
|
ctx.stroke();
|
|
@@ -115,6 +129,7 @@ Progress.prototype.draw = function (ctx) {
|
|
|
115
129
|
var text = this._text || (percent | 0) + '%';
|
|
116
130
|
var w = ctx.measureText(text).width;
|
|
117
131
|
|
|
132
|
+
ctx.fillStyle = colors.text;
|
|
118
133
|
ctx.fillText(text, x - w / 2 + 1, y + fontSize / 2 - 1);
|
|
119
134
|
} catch (ignore) {
|
|
120
135
|
// don't fail if we can't render progress
|
package/lib/interfaces/bdd.js
CHANGED
|
@@ -40,9 +40,9 @@ module.exports = function bddInterface(suite) {
|
|
|
40
40
|
|
|
41
41
|
context.describe = context.context = function (title, fn) {
|
|
42
42
|
return common.suite.create({
|
|
43
|
-
title
|
|
44
|
-
file
|
|
45
|
-
fn
|
|
43
|
+
title,
|
|
44
|
+
file,
|
|
45
|
+
fn
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -55,9 +55,9 @@ module.exports = function bddInterface(suite) {
|
|
|
55
55
|
context.describe.skip =
|
|
56
56
|
function (title, fn) {
|
|
57
57
|
return common.suite.skip({
|
|
58
|
-
title
|
|
59
|
-
file
|
|
60
|
-
fn
|
|
58
|
+
title,
|
|
59
|
+
file,
|
|
60
|
+
fn
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
@@ -67,9 +67,9 @@ module.exports = function bddInterface(suite) {
|
|
|
67
67
|
|
|
68
68
|
context.describe.only = function (title, fn) {
|
|
69
69
|
return common.suite.only({
|
|
70
|
-
title
|
|
71
|
-
file
|
|
72
|
-
fn
|
|
70
|
+
title,
|
|
71
|
+
file,
|
|
72
|
+
fn
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
|
package/lib/interfaces/qunit.js
CHANGED
|
@@ -49,8 +49,8 @@ module.exports = function qUnitInterface(suite) {
|
|
|
49
49
|
suites.shift();
|
|
50
50
|
}
|
|
51
51
|
return common.suite.create({
|
|
52
|
-
title
|
|
53
|
-
file
|
|
52
|
+
title,
|
|
53
|
+
file,
|
|
54
54
|
fn: false
|
|
55
55
|
});
|
|
56
56
|
};
|
|
@@ -64,8 +64,8 @@ module.exports = function qUnitInterface(suite) {
|
|
|
64
64
|
suites.shift();
|
|
65
65
|
}
|
|
66
66
|
return common.suite.only({
|
|
67
|
-
title
|
|
68
|
-
file
|
|
67
|
+
title,
|
|
68
|
+
file,
|
|
69
69
|
fn: false
|
|
70
70
|
});
|
|
71
71
|
};
|
package/lib/interfaces/tdd.js
CHANGED
|
@@ -47,9 +47,9 @@ module.exports = function (suite) {
|
|
|
47
47
|
*/
|
|
48
48
|
context.suite = function (title, fn) {
|
|
49
49
|
return common.suite.create({
|
|
50
|
-
title
|
|
51
|
-
file
|
|
52
|
-
fn
|
|
50
|
+
title,
|
|
51
|
+
file,
|
|
52
|
+
fn
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
55
|
|
|
@@ -58,9 +58,9 @@ module.exports = function (suite) {
|
|
|
58
58
|
*/
|
|
59
59
|
context.suite.skip = function (title, fn) {
|
|
60
60
|
return common.suite.skip({
|
|
61
|
-
title
|
|
62
|
-
file
|
|
63
|
-
fn
|
|
61
|
+
title,
|
|
62
|
+
file,
|
|
63
|
+
fn
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
66
|
|
|
@@ -69,9 +69,9 @@ module.exports = function (suite) {
|
|
|
69
69
|
*/
|
|
70
70
|
context.suite.only = function (title, fn) {
|
|
71
71
|
return common.suite.only({
|
|
72
|
-
title
|
|
73
|
-
file
|
|
74
|
-
fn
|
|
72
|
+
title,
|
|
73
|
+
file,
|
|
74
|
+
fn
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
const allSettled = require('@ungap/promise-all-settled').bind(Promise);
|
|
10
9
|
const Runner = require('../runner');
|
|
11
10
|
const {EVENT_RUN_BEGIN, EVENT_RUN_END} = Runner.constants;
|
|
12
11
|
const debug = require('debug')('mocha:parallel:parallel-buffered-runner');
|
|
@@ -322,7 +321,7 @@ class ParallelBufferedRunner extends Runner {
|
|
|
322
321
|
delete options[opt];
|
|
323
322
|
});
|
|
324
323
|
|
|
325
|
-
const results = await allSettled(
|
|
324
|
+
const results = await Promise.allSettled(
|
|
326
325
|
files.map(this._createFileRunner(pool, options))
|
|
327
326
|
);
|
|
328
327
|
|
|
@@ -50,7 +50,7 @@ function Markdown(runner, options) {
|
|
|
50
50
|
var ret = obj;
|
|
51
51
|
var key = SUITE_PREFIX + suite.title;
|
|
52
52
|
|
|
53
|
-
obj = obj[key] = obj[key] || {suite
|
|
53
|
+
obj = obj[key] = obj[key] || {suite};
|
|
54
54
|
suite.suites.forEach(function (suite) {
|
|
55
55
|
mapTOC(suite, obj);
|
|
56
56
|
});
|
package/lib/utils.js
CHANGED
|
@@ -76,7 +76,7 @@ exports.clean = function (str) {
|
|
|
76
76
|
.replace(/^\uFEFF/, '')
|
|
77
77
|
// (traditional)-> space/name parameters body (lambda)-> parameters body multi-statement/single keep body content
|
|
78
78
|
.replace(
|
|
79
|
-
/^function(?:\s*|\s
|
|
79
|
+
/^function(?:\s*|\s[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\}|((?:.|\n)*))$/,
|
|
80
80
|
'$1$2$3'
|
|
81
81
|
);
|
|
82
82
|
|
package/mocha.css
CHANGED
|
@@ -1,7 +1,73 @@
|
|
|
1
1
|
@charset "utf-8";
|
|
2
2
|
|
|
3
|
+
:root {
|
|
4
|
+
--mocha-color: #000;
|
|
5
|
+
--mocha-bg-color: #fff;
|
|
6
|
+
--mocha-pass-icon-color: #00d6b2;
|
|
7
|
+
--mocha-pass-color: #fff;
|
|
8
|
+
--mocha-pass-shadow-color: rgba(0,0,0,.2);
|
|
9
|
+
--mocha-pass-mediump-color: #c09853;
|
|
10
|
+
--mocha-pass-slow-color: #b94a48;
|
|
11
|
+
--mocha-test-pending-color: #0b97c4;
|
|
12
|
+
--mocha-test-pending-icon-color: #0b97c4;
|
|
13
|
+
--mocha-test-fail-color: #c00;
|
|
14
|
+
--mocha-test-fail-icon-color: #c00;
|
|
15
|
+
--mocha-test-fail-pre-color: #000;
|
|
16
|
+
--mocha-test-fail-pre-error-color: #c00;
|
|
17
|
+
--mocha-test-html-error-color: #000;
|
|
18
|
+
--mocha-box-shadow-color: #eee;
|
|
19
|
+
--mocha-box-bottom-color: #ddd;
|
|
20
|
+
--mocha-test-replay-color: #000;
|
|
21
|
+
--mocha-test-replay-bg-color: #eee;
|
|
22
|
+
--mocha-stats-color: #888;
|
|
23
|
+
--mocha-stats-em-color: #000;
|
|
24
|
+
--mocha-stats-hover-color: #eee;
|
|
25
|
+
--mocha-error-color: #c00;
|
|
26
|
+
|
|
27
|
+
--mocha-code-comment: #ddd;
|
|
28
|
+
--mocha-code-init: #2f6fad;
|
|
29
|
+
--mocha-code-string: #5890ad;
|
|
30
|
+
--mocha-code-keyword: #8a6343;
|
|
31
|
+
--mocha-code-number: #2f6fad;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (prefers-color-scheme: dark) {
|
|
35
|
+
:root {
|
|
36
|
+
--mocha-color: #fff;
|
|
37
|
+
--mocha-bg-color: #222;
|
|
38
|
+
--mocha-pass-icon-color: #00d6b2;
|
|
39
|
+
--mocha-pass-color: #222;
|
|
40
|
+
--mocha-pass-shadow-color: rgba(255,255,255,.2);
|
|
41
|
+
--mocha-pass-mediump-color: #f1be67;
|
|
42
|
+
--mocha-pass-slow-color: #f49896;
|
|
43
|
+
--mocha-test-pending-color: #0b97c4;
|
|
44
|
+
--mocha-test-pending-icon-color: #0b97c4;
|
|
45
|
+
--mocha-test-fail-color: #f44;
|
|
46
|
+
--mocha-test-fail-icon-color: #f44;
|
|
47
|
+
--mocha-test-fail-pre-color: #fff;
|
|
48
|
+
--mocha-test-fail-pre-error-color: #f44;
|
|
49
|
+
--mocha-test-html-error-color: #fff;
|
|
50
|
+
--mocha-box-shadow-color: #444;
|
|
51
|
+
--mocha-box-bottom-color: #555;
|
|
52
|
+
--mocha-test-replay-color: #fff;
|
|
53
|
+
--mocha-test-replay-bg-color: #444;
|
|
54
|
+
--mocha-stats-color: #aaa;
|
|
55
|
+
--mocha-stats-em-color: #fff;
|
|
56
|
+
--mocha-stats-hover-color: #444;
|
|
57
|
+
--mocha-error-color: #f44;
|
|
58
|
+
|
|
59
|
+
--mocha-code-comment: #ddd;
|
|
60
|
+
--mocha-code-init: #9cc7f1;
|
|
61
|
+
--mocha-code-string: #80d4ff;
|
|
62
|
+
--mocha-code-keyword: #e3a470;
|
|
63
|
+
--mocha-code-number: #4ca7ff;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
3
67
|
body {
|
|
4
68
|
margin:0;
|
|
69
|
+
background-color: var(--mocha-bg-color);
|
|
70
|
+
color: var(--mocha-color);
|
|
5
71
|
}
|
|
6
72
|
|
|
7
73
|
#mocha {
|
|
@@ -69,11 +135,11 @@ body {
|
|
|
69
135
|
}
|
|
70
136
|
|
|
71
137
|
#mocha .test.pass.medium .duration {
|
|
72
|
-
background:
|
|
138
|
+
background: var(--mocha-pass-mediump-color);
|
|
73
139
|
}
|
|
74
140
|
|
|
75
141
|
#mocha .test.pass.slow .duration {
|
|
76
|
-
background:
|
|
142
|
+
background: var(--mocha-pass-slow-color);
|
|
77
143
|
}
|
|
78
144
|
|
|
79
145
|
#mocha .test.pass::before {
|
|
@@ -82,17 +148,17 @@ body {
|
|
|
82
148
|
display: block;
|
|
83
149
|
float: left;
|
|
84
150
|
margin-right: 5px;
|
|
85
|
-
color:
|
|
151
|
+
color: var(--mocha-pass-icon-color);
|
|
86
152
|
}
|
|
87
153
|
|
|
88
154
|
#mocha .test.pass .duration {
|
|
89
155
|
font-size: 9px;
|
|
90
156
|
margin-left: 5px;
|
|
91
157
|
padding: 2px 5px;
|
|
92
|
-
color:
|
|
93
|
-
-webkit-box-shadow: inset 0 1px 1px
|
|
94
|
-
-moz-box-shadow: inset 0 1px 1px
|
|
95
|
-
box-shadow: inset 0 1px 1px
|
|
158
|
+
color: var(--mocha-pass-color);
|
|
159
|
+
-webkit-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
|
|
160
|
+
-moz-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
|
|
161
|
+
box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
|
|
96
162
|
-webkit-border-radius: 5px;
|
|
97
163
|
-moz-border-radius: 5px;
|
|
98
164
|
-ms-border-radius: 5px;
|
|
@@ -105,20 +171,20 @@ body {
|
|
|
105
171
|
}
|
|
106
172
|
|
|
107
173
|
#mocha .test.pending {
|
|
108
|
-
color:
|
|
174
|
+
color: var(--mocha-test-pending-color);
|
|
109
175
|
}
|
|
110
176
|
|
|
111
177
|
#mocha .test.pending::before {
|
|
112
178
|
content: '◦';
|
|
113
|
-
color:
|
|
179
|
+
color: var(--mocha-test-pending-icon-color);
|
|
114
180
|
}
|
|
115
181
|
|
|
116
182
|
#mocha .test.fail {
|
|
117
|
-
color:
|
|
183
|
+
color: var(--mocha-test-fail-color);
|
|
118
184
|
}
|
|
119
185
|
|
|
120
186
|
#mocha .test.fail pre {
|
|
121
|
-
color:
|
|
187
|
+
color: var(--mocha-test-fail-pre-color);
|
|
122
188
|
}
|
|
123
189
|
|
|
124
190
|
#mocha .test.fail::before {
|
|
@@ -127,35 +193,35 @@ body {
|
|
|
127
193
|
display: block;
|
|
128
194
|
float: left;
|
|
129
195
|
margin-right: 5px;
|
|
130
|
-
color:
|
|
196
|
+
color: var(--mocha-pass-icon-color);
|
|
131
197
|
}
|
|
132
198
|
|
|
133
199
|
#mocha .test pre.error {
|
|
134
|
-
color:
|
|
200
|
+
color: var(--mocha-test-fail-pre-error-color);
|
|
135
201
|
max-height: 300px;
|
|
136
202
|
overflow: auto;
|
|
137
203
|
}
|
|
138
204
|
|
|
139
205
|
#mocha .test .html-error {
|
|
140
206
|
overflow: auto;
|
|
141
|
-
color:
|
|
207
|
+
color: var(--mocha-test-html-error-color);
|
|
142
208
|
display: block;
|
|
143
209
|
float: left;
|
|
144
210
|
clear: left;
|
|
145
211
|
font: 12px/1.5 monaco, monospace;
|
|
146
212
|
margin: 5px;
|
|
147
213
|
padding: 15px;
|
|
148
|
-
border: 1px solid
|
|
214
|
+
border: 1px solid var(--mocha-box-shadow-color);
|
|
149
215
|
max-width: 85%; /*(1)*/
|
|
150
216
|
max-width: -webkit-calc(100% - 42px);
|
|
151
217
|
max-width: -moz-calc(100% - 42px);
|
|
152
218
|
max-width: calc(100% - 42px); /*(2)*/
|
|
153
219
|
max-height: 300px;
|
|
154
220
|
word-wrap: break-word;
|
|
155
|
-
border-bottom-color:
|
|
156
|
-
-webkit-box-shadow: 0 1px 3px
|
|
157
|
-
-moz-box-shadow: 0 1px 3px
|
|
158
|
-
box-shadow: 0 1px 3px
|
|
221
|
+
border-bottom-color: var(--mocha-box-bottom-color);
|
|
222
|
+
-webkit-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
|
|
223
|
+
-moz-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
|
|
224
|
+
box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
|
|
159
225
|
-webkit-border-radius: 3px;
|
|
160
226
|
-moz-border-radius: 3px;
|
|
161
227
|
border-radius: 3px;
|
|
@@ -187,16 +253,16 @@ body {
|
|
|
187
253
|
font: 12px/1.5 monaco, monospace;
|
|
188
254
|
margin: 5px;
|
|
189
255
|
padding: 15px;
|
|
190
|
-
border: 1px solid
|
|
256
|
+
border: 1px solid var(--mocha-box-shadow-color);
|
|
191
257
|
max-width: 85%; /*(1)*/
|
|
192
258
|
max-width: -webkit-calc(100% - 42px);
|
|
193
259
|
max-width: -moz-calc(100% - 42px);
|
|
194
260
|
max-width: calc(100% - 42px); /*(2)*/
|
|
195
261
|
word-wrap: break-word;
|
|
196
|
-
border-bottom-color:
|
|
197
|
-
-webkit-box-shadow: 0 1px 3px
|
|
198
|
-
-moz-box-shadow: 0 1px 3px
|
|
199
|
-
box-shadow: 0 1px 3px
|
|
262
|
+
border-bottom-color: var(--mocha-box-bottom-color);
|
|
263
|
+
-webkit-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
|
|
264
|
+
-moz-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
|
|
265
|
+
box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
|
|
200
266
|
-webkit-border-radius: 3px;
|
|
201
267
|
-moz-border-radius: 3px;
|
|
202
268
|
border-radius: 3px;
|
|
@@ -217,7 +283,7 @@ body {
|
|
|
217
283
|
height: 15px;
|
|
218
284
|
line-height: 15px;
|
|
219
285
|
text-align: center;
|
|
220
|
-
background:
|
|
286
|
+
background: var(--mocha-test-replay-bg-color);
|
|
221
287
|
font-size: 15px;
|
|
222
288
|
-webkit-border-radius: 15px;
|
|
223
289
|
-moz-border-radius: 15px;
|
|
@@ -226,11 +292,12 @@ body {
|
|
|
226
292
|
-moz-transition:opacity 200ms;
|
|
227
293
|
-o-transition:opacity 200ms;
|
|
228
294
|
transition: opacity 200ms;
|
|
229
|
-
opacity: 0.
|
|
230
|
-
color:
|
|
295
|
+
opacity: 0.7;
|
|
296
|
+
color: var(--mocha-test-replay-color);
|
|
231
297
|
}
|
|
232
298
|
|
|
233
299
|
#mocha .test:hover a.replay {
|
|
300
|
+
box-shadow: 0 0 1px inset var(--mocha-test-replay-color);
|
|
234
301
|
opacity: 1;
|
|
235
302
|
}
|
|
236
303
|
|
|
@@ -251,7 +318,7 @@ body {
|
|
|
251
318
|
}
|
|
252
319
|
|
|
253
320
|
#mocha-error {
|
|
254
|
-
color:
|
|
321
|
+
color: var(--mocha-error-color);
|
|
255
322
|
font-size: 1.5em;
|
|
256
323
|
font-weight: 100;
|
|
257
324
|
letter-spacing: 1px;
|
|
@@ -263,7 +330,7 @@ body {
|
|
|
263
330
|
right: 10px;
|
|
264
331
|
font-size: 12px;
|
|
265
332
|
margin: 0;
|
|
266
|
-
color:
|
|
333
|
+
color: var(--mocha-stats-color);
|
|
267
334
|
z-index: 1;
|
|
268
335
|
}
|
|
269
336
|
|
|
@@ -284,7 +351,7 @@ body {
|
|
|
284
351
|
}
|
|
285
352
|
|
|
286
353
|
#mocha-stats em {
|
|
287
|
-
color:
|
|
354
|
+
color: var(--mocha-stats-em-color);
|
|
288
355
|
}
|
|
289
356
|
|
|
290
357
|
#mocha-stats a {
|
|
@@ -293,7 +360,7 @@ body {
|
|
|
293
360
|
}
|
|
294
361
|
|
|
295
362
|
#mocha-stats a:hover {
|
|
296
|
-
border-bottom: 1px solid
|
|
363
|
+
border-bottom: 1px solid var(--mocha-stats-hover-color);
|
|
297
364
|
}
|
|
298
365
|
|
|
299
366
|
#mocha-stats li {
|
|
@@ -308,11 +375,11 @@ body {
|
|
|
308
375
|
height: 40px;
|
|
309
376
|
}
|
|
310
377
|
|
|
311
|
-
#mocha code .comment { color:
|
|
312
|
-
#mocha code .init { color:
|
|
313
|
-
#mocha code .string { color:
|
|
314
|
-
#mocha code .keyword { color:
|
|
315
|
-
#mocha code .number { color:
|
|
378
|
+
#mocha code .comment { color: var(--mocha-code-comment); }
|
|
379
|
+
#mocha code .init { color: var(--mocha-code-init); }
|
|
380
|
+
#mocha code .string { color: var(--mocha-code-string); }
|
|
381
|
+
#mocha code .keyword { color: var(--mocha-code-keyword); }
|
|
382
|
+
#mocha code .number { color: var(--mocha-code-number); }
|
|
316
383
|
|
|
317
384
|
@media screen and (max-device-width: 480px) {
|
|
318
385
|
#mocha {
|
package/mocha.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// mocha@10.
|
|
1
|
+
// mocha@10.1.0 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) :
|
|
@@ -10899,7 +10899,7 @@
|
|
|
10899
10899
|
.replace(/^\uFEFF/, '')
|
|
10900
10900
|
// (traditional)-> space/name parameters body (lambda)-> parameters body multi-statement/single keep body content
|
|
10901
10901
|
.replace(
|
|
10902
|
-
/^function(?:\s*|\s
|
|
10902
|
+
/^function(?:\s*|\s[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\}|((?:.|\n)*))$/,
|
|
10903
10903
|
'$1$2$3'
|
|
10904
10904
|
);
|
|
10905
10905
|
|
|
@@ -16542,6 +16542,20 @@
|
|
|
16542
16542
|
*/
|
|
16543
16543
|
Progress.prototype.draw = function (ctx) {
|
|
16544
16544
|
try {
|
|
16545
|
+
var darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');
|
|
16546
|
+
var isDarkMode = !!darkMatcher.matches;
|
|
16547
|
+
var lightColors = {
|
|
16548
|
+
outerCircle: '#9f9f9f',
|
|
16549
|
+
innerCircle: '#eee',
|
|
16550
|
+
text: '#000'
|
|
16551
|
+
};
|
|
16552
|
+
var darkColors = {
|
|
16553
|
+
outerCircle: '#888',
|
|
16554
|
+
innerCircle: '#444',
|
|
16555
|
+
text: '#fff'
|
|
16556
|
+
};
|
|
16557
|
+
var colors = isDarkMode ? darkColors : lightColors;
|
|
16558
|
+
|
|
16545
16559
|
var percent = Math.min(this.percent, 100);
|
|
16546
16560
|
var size = this._size;
|
|
16547
16561
|
var half = size / 2;
|
|
@@ -16556,13 +16570,13 @@
|
|
|
16556
16570
|
ctx.clearRect(0, 0, size, size);
|
|
16557
16571
|
|
|
16558
16572
|
// outer circle
|
|
16559
|
-
ctx.strokeStyle =
|
|
16573
|
+
ctx.strokeStyle = colors.outerCircle;
|
|
16560
16574
|
ctx.beginPath();
|
|
16561
16575
|
ctx.arc(x, y, rad, 0, angle, false);
|
|
16562
16576
|
ctx.stroke();
|
|
16563
16577
|
|
|
16564
16578
|
// inner circle
|
|
16565
|
-
ctx.strokeStyle =
|
|
16579
|
+
ctx.strokeStyle = colors.innerCircle;
|
|
16566
16580
|
ctx.beginPath();
|
|
16567
16581
|
ctx.arc(x, y, rad - 1, 0, angle, true);
|
|
16568
16582
|
ctx.stroke();
|
|
@@ -16571,6 +16585,7 @@
|
|
|
16571
16585
|
var text = this._text || (percent | 0) + '%';
|
|
16572
16586
|
var w = ctx.measureText(text).width;
|
|
16573
16587
|
|
|
16588
|
+
ctx.fillStyle = colors.text;
|
|
16574
16589
|
ctx.fillText(text, x - w / 2 + 1, y + fontSize / 2 - 1);
|
|
16575
16590
|
} catch (ignore) {
|
|
16576
16591
|
// don't fail if we can't render progress
|
|
@@ -17766,7 +17781,7 @@
|
|
|
17766
17781
|
var ret = obj;
|
|
17767
17782
|
var key = SUITE_PREFIX + suite.title;
|
|
17768
17783
|
|
|
17769
|
-
obj = obj[key] = obj[key] || {suite
|
|
17784
|
+
obj = obj[key] = obj[key] || {suite};
|
|
17770
17785
|
suite.suites.forEach(function (suite) {
|
|
17771
17786
|
mapTOC(suite, obj);
|
|
17772
17787
|
});
|
|
@@ -18096,7 +18111,7 @@
|
|
|
18096
18111
|
var total = runner.total;
|
|
18097
18112
|
|
|
18098
18113
|
runner.once(EVENT_RUN_BEGIN, function () {
|
|
18099
|
-
writeEvent(['start', {total
|
|
18114
|
+
writeEvent(['start', {total}]);
|
|
18100
18115
|
});
|
|
18101
18116
|
|
|
18102
18117
|
runner.on(EVENT_TEST_PASS, function (test) {
|
|
@@ -18628,9 +18643,9 @@
|
|
|
18628
18643
|
|
|
18629
18644
|
context.describe = context.context = function (title, fn) {
|
|
18630
18645
|
return common$1.suite.create({
|
|
18631
|
-
title
|
|
18632
|
-
file
|
|
18633
|
-
fn
|
|
18646
|
+
title,
|
|
18647
|
+
file,
|
|
18648
|
+
fn
|
|
18634
18649
|
});
|
|
18635
18650
|
};
|
|
18636
18651
|
|
|
@@ -18643,9 +18658,9 @@
|
|
|
18643
18658
|
context.describe.skip =
|
|
18644
18659
|
function (title, fn) {
|
|
18645
18660
|
return common$1.suite.skip({
|
|
18646
|
-
title
|
|
18647
|
-
file
|
|
18648
|
-
fn
|
|
18661
|
+
title,
|
|
18662
|
+
file,
|
|
18663
|
+
fn
|
|
18649
18664
|
});
|
|
18650
18665
|
};
|
|
18651
18666
|
|
|
@@ -18655,9 +18670,9 @@
|
|
|
18655
18670
|
|
|
18656
18671
|
context.describe.only = function (title, fn) {
|
|
18657
18672
|
return common$1.suite.only({
|
|
18658
|
-
title
|
|
18659
|
-
file
|
|
18660
|
-
fn
|
|
18673
|
+
title,
|
|
18674
|
+
file,
|
|
18675
|
+
fn
|
|
18661
18676
|
});
|
|
18662
18677
|
};
|
|
18663
18678
|
|
|
@@ -18750,9 +18765,9 @@
|
|
|
18750
18765
|
*/
|
|
18751
18766
|
context.suite = function (title, fn) {
|
|
18752
18767
|
return common$1.suite.create({
|
|
18753
|
-
title
|
|
18754
|
-
file
|
|
18755
|
-
fn
|
|
18768
|
+
title,
|
|
18769
|
+
file,
|
|
18770
|
+
fn
|
|
18756
18771
|
});
|
|
18757
18772
|
};
|
|
18758
18773
|
|
|
@@ -18761,9 +18776,9 @@
|
|
|
18761
18776
|
*/
|
|
18762
18777
|
context.suite.skip = function (title, fn) {
|
|
18763
18778
|
return common$1.suite.skip({
|
|
18764
|
-
title
|
|
18765
|
-
file
|
|
18766
|
-
fn
|
|
18779
|
+
title,
|
|
18780
|
+
file,
|
|
18781
|
+
fn
|
|
18767
18782
|
});
|
|
18768
18783
|
};
|
|
18769
18784
|
|
|
@@ -18772,9 +18787,9 @@
|
|
|
18772
18787
|
*/
|
|
18773
18788
|
context.suite.only = function (title, fn) {
|
|
18774
18789
|
return common$1.suite.only({
|
|
18775
|
-
title
|
|
18776
|
-
file
|
|
18777
|
-
fn
|
|
18790
|
+
title,
|
|
18791
|
+
file,
|
|
18792
|
+
fn
|
|
18778
18793
|
});
|
|
18779
18794
|
};
|
|
18780
18795
|
|
|
@@ -18859,8 +18874,8 @@
|
|
|
18859
18874
|
suites.shift();
|
|
18860
18875
|
}
|
|
18861
18876
|
return common$1.suite.create({
|
|
18862
|
-
title
|
|
18863
|
-
file
|
|
18877
|
+
title,
|
|
18878
|
+
file,
|
|
18864
18879
|
fn: false
|
|
18865
18880
|
});
|
|
18866
18881
|
};
|
|
@@ -18874,8 +18889,8 @@
|
|
|
18874
18889
|
suites.shift();
|
|
18875
18890
|
}
|
|
18876
18891
|
return common$1.suite.only({
|
|
18877
|
-
title
|
|
18878
|
-
file
|
|
18892
|
+
title,
|
|
18893
|
+
file,
|
|
18879
18894
|
fn: false
|
|
18880
18895
|
});
|
|
18881
18896
|
};
|
|
@@ -19061,7 +19076,7 @@
|
|
|
19061
19076
|
};
|
|
19062
19077
|
|
|
19063
19078
|
var name = "mocha";
|
|
19064
|
-
var version = "10.
|
|
19079
|
+
var version = "10.1.0";
|
|
19065
19080
|
var homepage = "https://mochajs.org/";
|
|
19066
19081
|
var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
|
|
19067
19082
|
var require$$17 = {
|