@rstest/core 0.9.4 → 0.9.5
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/LICENSE.md +0 -228
- package/dist/0~8843.js +23 -13
- package/dist/0~browserLoader.js +1 -1
- package/dist/0~browser~1.js +4 -4
- package/dist/0~checkThresholds.js +1 -1
- package/dist/0~console.js +1 -1
- package/dist/0~fake-timers.js +1483 -0
- package/dist/0~generate.js +4 -3
- package/dist/0~happyDom.js +1 -1
- package/dist/0~jsdom.js +1 -1
- package/dist/0~listTests.js +3 -3
- package/dist/0~loadModule.js +1 -1
- package/dist/0~runTests.js +11 -4
- package/dist/0~snapshot.js +2140 -0
- package/dist/0~snapshot.js.LICENSE.txt +7 -0
- package/dist/0~utils.js +1 -1
- package/dist/1949.js +2919 -9808
- package/dist/1949.js.LICENSE.txt +1 -49
- package/dist/3145.js +318 -36
- package/dist/4411.js +232 -47
- package/dist/6830.js +61 -9
- package/dist/7552.js +22 -4918
- package/dist/9743.js +1982 -0
- package/dist/9784.js +1343 -0
- package/dist/{7552.js.LICENSE.txt → 9784.js.LICENSE.txt} +19 -8
- package/dist/browser-runtime/2~fake-timers.js +1653 -0
- package/dist/browser-runtime/2~snapshot.js +2138 -0
- package/dist/browser-runtime/2~snapshot.js.LICENSE.txt +7 -0
- package/dist/browser-runtime/723.js +2055 -10605
- package/dist/browser-runtime/723.js.LICENSE.txt +0 -17
- package/dist/browser-runtime/index.d.ts +189 -11
- package/dist/browser-runtime/rslib-runtime.js +0 -7
- package/dist/browser.d.ts +39 -5
- package/dist/browser.js +2 -2
- package/dist/globalSetupWorker.js +1 -1
- package/dist/index.d.ts +39 -5
- package/dist/mockRuntimeCode.js +2 -0
- package/dist/worker.d.ts +31 -5
- package/dist/worker.js +11 -9
- package/package.json +21 -22
package/dist/4411.js
CHANGED
|
@@ -8,9 +8,9 @@ import { createRequire } from "module";
|
|
|
8
8
|
import { logger as logger_logger, parsePosix, color as logger_color, castArray } from "./6830.js";
|
|
9
9
|
import { posix as dist_posix } from "./7011.js";
|
|
10
10
|
__webpack_require__.add({
|
|
11
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
12
|
-
const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
13
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
11
|
+
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12
|
+
const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js");
|
|
13
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
14
14
|
function picomatch(glob, options, returnState = false) {
|
|
15
15
|
if (options && (null === options.windows || void 0 === options.windows)) options = {
|
|
16
16
|
...options,
|
|
@@ -21,9 +21,10 @@ __webpack_require__.add({
|
|
|
21
21
|
Object.assign(picomatch, pico);
|
|
22
22
|
module.exports = picomatch;
|
|
23
23
|
},
|
|
24
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
24
|
+
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js" (module) {
|
|
25
25
|
const WIN_SLASH = '\\\\/';
|
|
26
26
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
27
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
27
28
|
const DOT_LITERAL = '\\.';
|
|
28
29
|
const PLUS_LITERAL = '\\+';
|
|
29
30
|
const QMARK_LITERAL = '\\?';
|
|
@@ -74,6 +75,7 @@ __webpack_require__.add({
|
|
|
74
75
|
SEP: '\\'
|
|
75
76
|
};
|
|
76
77
|
const POSIX_REGEX_SOURCE = {
|
|
78
|
+
__proto__: null,
|
|
77
79
|
alnum: 'a-zA-Z0-9',
|
|
78
80
|
alpha: 'a-zA-Z',
|
|
79
81
|
ascii: '\\x00-\\x7F',
|
|
@@ -90,6 +92,7 @@ __webpack_require__.add({
|
|
|
90
92
|
xdigit: 'A-Fa-f0-9'
|
|
91
93
|
};
|
|
92
94
|
module.exports = {
|
|
95
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
93
96
|
MAX_LENGTH: 65536,
|
|
94
97
|
POSIX_REGEX_SOURCE,
|
|
95
98
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -181,9 +184,9 @@ __webpack_require__.add({
|
|
|
181
184
|
}
|
|
182
185
|
};
|
|
183
186
|
},
|
|
184
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
185
|
-
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
186
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
187
|
+
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
188
|
+
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
189
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
187
190
|
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
188
191
|
const expandRange = (args, options)=>{
|
|
189
192
|
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
|
|
@@ -197,6 +200,189 @@ __webpack_require__.add({
|
|
|
197
200
|
return value;
|
|
198
201
|
};
|
|
199
202
|
const syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
203
|
+
const splitTopLevel = (input)=>{
|
|
204
|
+
const parts = [];
|
|
205
|
+
let bracket = 0;
|
|
206
|
+
let paren = 0;
|
|
207
|
+
let quote = 0;
|
|
208
|
+
let value = '';
|
|
209
|
+
let escaped = false;
|
|
210
|
+
for (const ch of input){
|
|
211
|
+
if (true === escaped) {
|
|
212
|
+
value += ch;
|
|
213
|
+
escaped = false;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if ('\\' === ch) {
|
|
217
|
+
value += ch;
|
|
218
|
+
escaped = true;
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if ('"' === ch) {
|
|
222
|
+
quote = 1 === quote ? 0 : 1;
|
|
223
|
+
value += ch;
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (0 === quote) {
|
|
227
|
+
if ('[' === ch) bracket++;
|
|
228
|
+
else if (']' === ch && bracket > 0) bracket--;
|
|
229
|
+
else if (0 === bracket) {
|
|
230
|
+
if ('(' === ch) paren++;
|
|
231
|
+
else if (')' === ch && paren > 0) paren--;
|
|
232
|
+
else if ('|' === ch && 0 === paren) {
|
|
233
|
+
parts.push(value);
|
|
234
|
+
value = '';
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
value += ch;
|
|
240
|
+
}
|
|
241
|
+
parts.push(value);
|
|
242
|
+
return parts;
|
|
243
|
+
};
|
|
244
|
+
const isPlainBranch = (branch)=>{
|
|
245
|
+
let escaped = false;
|
|
246
|
+
for (const ch of branch){
|
|
247
|
+
if (true === escaped) {
|
|
248
|
+
escaped = false;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if ('\\' === ch) {
|
|
252
|
+
escaped = true;
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
if (/[?*+@!()[\]{}]/.test(ch)) return false;
|
|
256
|
+
}
|
|
257
|
+
return true;
|
|
258
|
+
};
|
|
259
|
+
const normalizeSimpleBranch = (branch)=>{
|
|
260
|
+
let value = branch.trim();
|
|
261
|
+
let changed = true;
|
|
262
|
+
while(true === changed){
|
|
263
|
+
changed = false;
|
|
264
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
265
|
+
value = value.slice(2, -1);
|
|
266
|
+
changed = true;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (!isPlainBranch(value)) return;
|
|
270
|
+
return value.replace(/\\(.)/g, '$1');
|
|
271
|
+
};
|
|
272
|
+
const hasRepeatedCharPrefixOverlap = (branches)=>{
|
|
273
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
274
|
+
for(let i = 0; i < values.length; i++)for(let j = i + 1; j < values.length; j++){
|
|
275
|
+
const a = values[i];
|
|
276
|
+
const b = values[j];
|
|
277
|
+
const char = a[0];
|
|
278
|
+
if (char && a === char.repeat(a.length) && b === char.repeat(b.length)) {
|
|
279
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return false;
|
|
283
|
+
};
|
|
284
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true)=>{
|
|
285
|
+
if ('+' !== pattern[0] && '*' !== pattern[0] || '(' !== pattern[1]) return;
|
|
286
|
+
let bracket = 0;
|
|
287
|
+
let paren = 0;
|
|
288
|
+
let quote = 0;
|
|
289
|
+
let escaped = false;
|
|
290
|
+
for(let i = 1; i < pattern.length; i++){
|
|
291
|
+
const ch = pattern[i];
|
|
292
|
+
if (true === escaped) {
|
|
293
|
+
escaped = false;
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if ('\\' === ch) {
|
|
297
|
+
escaped = true;
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if ('"' === ch) {
|
|
301
|
+
quote = 1 === quote ? 0 : 1;
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
if (1 !== quote) {
|
|
305
|
+
if ('[' === ch) {
|
|
306
|
+
bracket++;
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (']' === ch && bracket > 0) {
|
|
310
|
+
bracket--;
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if (!(bracket > 0)) {
|
|
314
|
+
if ('(' === ch) {
|
|
315
|
+
paren++;
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
if (')' === ch) {
|
|
319
|
+
paren--;
|
|
320
|
+
if (0 === paren) {
|
|
321
|
+
if (true === requireEnd && i !== pattern.length - 1) return;
|
|
322
|
+
return {
|
|
323
|
+
type: pattern[0],
|
|
324
|
+
body: pattern.slice(2, i),
|
|
325
|
+
end: i
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
const getStarExtglobSequenceOutput = (pattern)=>{
|
|
334
|
+
let index = 0;
|
|
335
|
+
const chars = [];
|
|
336
|
+
while(index < pattern.length){
|
|
337
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
338
|
+
if (!match || '*' !== match.type) return;
|
|
339
|
+
const branches = splitTopLevel(match.body).map((branch)=>branch.trim());
|
|
340
|
+
if (1 !== branches.length) return;
|
|
341
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
342
|
+
if (!branch || 1 !== branch.length) return;
|
|
343
|
+
chars.push(branch);
|
|
344
|
+
index += match.end + 1;
|
|
345
|
+
}
|
|
346
|
+
if (chars.length < 1) return;
|
|
347
|
+
const source = 1 === chars.length ? utils.escapeRegex(chars[0]) : `[${chars.map((ch)=>utils.escapeRegex(ch)).join('')}]`;
|
|
348
|
+
return `${source}*`;
|
|
349
|
+
};
|
|
350
|
+
const repeatedExtglobRecursion = (pattern)=>{
|
|
351
|
+
let depth = 0;
|
|
352
|
+
let value = pattern.trim();
|
|
353
|
+
let match = parseRepeatedExtglob(value);
|
|
354
|
+
while(match){
|
|
355
|
+
depth++;
|
|
356
|
+
value = match.body.trim();
|
|
357
|
+
match = parseRepeatedExtglob(value);
|
|
358
|
+
}
|
|
359
|
+
return depth;
|
|
360
|
+
};
|
|
361
|
+
const analyzeRepeatedExtglob = (body, options)=>{
|
|
362
|
+
if (false === options.maxExtglobRecursion) return {
|
|
363
|
+
risky: false
|
|
364
|
+
};
|
|
365
|
+
const max = 'number' == typeof options.maxExtglobRecursion ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
366
|
+
const branches = splitTopLevel(body).map((branch)=>branch.trim());
|
|
367
|
+
if (branches.length > 1) {
|
|
368
|
+
if (branches.some((branch)=>'' === branch) || branches.some((branch)=>/^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return {
|
|
369
|
+
risky: true
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
for (const branch of branches){
|
|
373
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
374
|
+
if (safeOutput) return {
|
|
375
|
+
risky: true,
|
|
376
|
+
safeOutput
|
|
377
|
+
};
|
|
378
|
+
if (repeatedExtglobRecursion(branch) > max) return {
|
|
379
|
+
risky: true
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
risky: false
|
|
384
|
+
};
|
|
385
|
+
};
|
|
200
386
|
const parse = (input, options)=>{
|
|
201
387
|
if ('string' != typeof input) throw new TypeError('Expected a string');
|
|
202
388
|
input = REPLACEMENTS[input] || input;
|
|
@@ -312,6 +498,8 @@ __webpack_require__.add({
|
|
|
312
498
|
token.prev = prev;
|
|
313
499
|
token.parens = state.parens;
|
|
314
500
|
token.output = state.output;
|
|
501
|
+
token.startIndex = state.index;
|
|
502
|
+
token.tokensIndex = tokens.length;
|
|
315
503
|
const output = (opts.capture ? '(' : '') + token.open;
|
|
316
504
|
increment('parens');
|
|
317
505
|
push({
|
|
@@ -328,6 +516,31 @@ __webpack_require__.add({
|
|
|
328
516
|
extglobs.push(token);
|
|
329
517
|
};
|
|
330
518
|
const extglobClose = (token)=>{
|
|
519
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
520
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
521
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
522
|
+
if (('plus' === token.type || 'star' === token.type) && analysis.risky) {
|
|
523
|
+
const safeOutput = analysis.safeOutput ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
524
|
+
const open = tokens[token.tokensIndex];
|
|
525
|
+
open.type = 'text';
|
|
526
|
+
open.value = literal;
|
|
527
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
528
|
+
for(let i = token.tokensIndex + 1; i < tokens.length; i++){
|
|
529
|
+
tokens[i].value = '';
|
|
530
|
+
tokens[i].output = '';
|
|
531
|
+
delete tokens[i].suffix;
|
|
532
|
+
}
|
|
533
|
+
state.output = token.output + open.output;
|
|
534
|
+
state.backtrack = true;
|
|
535
|
+
push({
|
|
536
|
+
type: 'paren',
|
|
537
|
+
extglob: true,
|
|
538
|
+
value,
|
|
539
|
+
output: ''
|
|
540
|
+
});
|
|
541
|
+
decrement('parens');
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
331
544
|
let output = token.close + (opts.capture ? ')' : '');
|
|
332
545
|
let rest;
|
|
333
546
|
if ('negate' === token.type) {
|
|
@@ -969,11 +1182,11 @@ __webpack_require__.add({
|
|
|
969
1182
|
};
|
|
970
1183
|
module.exports = parse;
|
|
971
1184
|
},
|
|
972
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
973
|
-
const scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
974
|
-
const parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
975
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
976
|
-
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1185
|
+
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1186
|
+
const scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js");
|
|
1187
|
+
const parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js");
|
|
1188
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
1189
|
+
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
977
1190
|
const isObject = (val)=>val && 'object' == typeof val && !Array.isArray(val);
|
|
978
1191
|
const picomatch = (glob, options, returnState = false)=>{
|
|
979
1192
|
if (Array.isArray(glob)) {
|
|
@@ -1102,9 +1315,9 @@ __webpack_require__.add({
|
|
|
1102
1315
|
picomatch.constants = constants;
|
|
1103
1316
|
module.exports = picomatch;
|
|
1104
1317
|
},
|
|
1105
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
1106
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1107
|
-
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1318
|
+
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1319
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
1320
|
+
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
1108
1321
|
const isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
1109
1322
|
const depth = (token)=>{
|
|
1110
1323
|
if (true !== token.isPrefix) token.depth = token.isGlobstar ? 1 / 0 : 1;
|
|
@@ -1370,8 +1583,8 @@ __webpack_require__.add({
|
|
|
1370
1583
|
};
|
|
1371
1584
|
module.exports = scan;
|
|
1372
1585
|
},
|
|
1373
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
1374
|
-
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1586
|
+
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1587
|
+
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
1375
1588
|
exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
|
|
1376
1589
|
exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str);
|
|
1377
1590
|
exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str);
|
|
@@ -1415,34 +1628,6 @@ __webpack_require__.add({
|
|
|
1415
1628
|
};
|
|
1416
1629
|
}
|
|
1417
1630
|
});
|
|
1418
|
-
const DEFAULT_CONFIG_NAME = 'rstest.config';
|
|
1419
|
-
const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
|
|
1420
|
-
const TEMP_RSTEST_OUTPUT_DIR = 'dist/.rstest-temp';
|
|
1421
|
-
const TEMP_RSTEST_OUTPUT_DIR_GLOB = '**/dist/.rstest-temp';
|
|
1422
|
-
const DEFAULT_CONFIG_EXTENSIONS = [
|
|
1423
|
-
'.js',
|
|
1424
|
-
'.ts',
|
|
1425
|
-
'.mjs',
|
|
1426
|
-
'.mts',
|
|
1427
|
-
'.cjs',
|
|
1428
|
-
'.cts'
|
|
1429
|
-
];
|
|
1430
|
-
const globalApis = [
|
|
1431
|
-
'test',
|
|
1432
|
-
'describe',
|
|
1433
|
-
'it',
|
|
1434
|
-
'expect',
|
|
1435
|
-
'afterAll',
|
|
1436
|
-
'afterEach',
|
|
1437
|
-
'beforeAll',
|
|
1438
|
-
'beforeEach',
|
|
1439
|
-
'rstest',
|
|
1440
|
-
'rs',
|
|
1441
|
-
'assert',
|
|
1442
|
-
'onTestFinished',
|
|
1443
|
-
'onTestFailed'
|
|
1444
|
-
];
|
|
1445
|
-
const TS_CONFIG_FILE = 'tsconfig.json';
|
|
1446
1631
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
1447
1632
|
function cleanPath(path) {
|
|
1448
1633
|
let normalized = normalize(path);
|
|
@@ -1928,7 +2113,7 @@ var Builder = class {
|
|
|
1928
2113
|
return this;
|
|
1929
2114
|
}
|
|
1930
2115
|
};
|
|
1931
|
-
const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
2116
|
+
const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js");
|
|
1932
2117
|
const isReadonlyArray = Array.isArray;
|
|
1933
2118
|
const isWin = "win32" === process.platform;
|
|
1934
2119
|
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
@@ -2317,4 +2502,4 @@ async function resolveShardedEntries(context) {
|
|
|
2317
2502
|
});
|
|
2318
2503
|
return entriesCache;
|
|
2319
2504
|
}
|
|
2320
|
-
export {
|
|
2505
|
+
export { filterProjects, formatTestEntryName, formatTestPath, getTestEntries, glob, isDynamicPattern, prettyTestPath, resolveShardedEntries };
|
package/dist/6830.js
CHANGED
|
@@ -292,12 +292,13 @@ const normalizeErrorMessage = (err)=>{
|
|
|
292
292
|
return err.message;
|
|
293
293
|
};
|
|
294
294
|
let createLogger = (options = {})=>{
|
|
295
|
-
|
|
295
|
+
const { level = 'info', prefix, console: console1 = globalThis.console } = options;
|
|
296
|
+
let maxLevel = level;
|
|
296
297
|
let log = (type, message, ...args)=>{
|
|
297
298
|
let logType = LOG_TYPES[type];
|
|
298
299
|
const { level } = logType;
|
|
299
300
|
if (LOG_LEVEL[level] > LOG_LEVEL[maxLevel]) return;
|
|
300
|
-
if (null == message) return
|
|
301
|
+
if (null == message) return console1.log();
|
|
301
302
|
let label = '';
|
|
302
303
|
let text = '';
|
|
303
304
|
if ('label' in logType) {
|
|
@@ -315,8 +316,9 @@ let createLogger = (options = {})=>{
|
|
|
315
316
|
let lines = message.split('\n');
|
|
316
317
|
text = lines.map((line)=>isErrorStackMessage(line) ? color.gray(line) : line).join('\n');
|
|
317
318
|
} else text = `${message}`;
|
|
319
|
+
if (prefix) text = `${prefix} ${text}`;
|
|
318
320
|
const method = 'error' === level || 'warn' === level ? level : 'log';
|
|
319
|
-
|
|
321
|
+
console1[method](label.length ? `${label} ${text}` : text, ...args);
|
|
320
322
|
};
|
|
321
323
|
let logger = {
|
|
322
324
|
greet: (message)=>log('log', gradient(message))
|
|
@@ -330,6 +332,11 @@ let createLogger = (options = {})=>{
|
|
|
330
332
|
maxLevel = val;
|
|
331
333
|
}
|
|
332
334
|
});
|
|
335
|
+
Object.defineProperty(logger, 'options', {
|
|
336
|
+
get: ()=>({
|
|
337
|
+
...options
|
|
338
|
+
})
|
|
339
|
+
});
|
|
333
340
|
logger.override = (customLogger)=>{
|
|
334
341
|
Object.assign(logger, customLogger);
|
|
335
342
|
};
|
|
@@ -1180,6 +1187,45 @@ const _path = {
|
|
|
1180
1187
|
sep: sep,
|
|
1181
1188
|
toNamespacedPath: toNamespacedPath
|
|
1182
1189
|
};
|
|
1190
|
+
const DEFAULT_CONFIG_NAME = 'rstest.config';
|
|
1191
|
+
const TEST_DELIMITER = '>';
|
|
1192
|
+
const POINTER = '➜';
|
|
1193
|
+
const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
|
|
1194
|
+
const TEMP_RSTEST_OUTPUT_DIR = 'dist/.rstest-temp';
|
|
1195
|
+
const getOutputDistPathRoot = (distPath)=>('string' == typeof distPath ? distPath : distPath?.root) ?? TEMP_RSTEST_OUTPUT_DIR;
|
|
1196
|
+
const getTempRstestOutputDir = ({ distPathRoot, environmentName, multipleProjects = false })=>{
|
|
1197
|
+
const outputRoot = normalize(distPathRoot);
|
|
1198
|
+
return multipleProjects && environmentName ? join(outputRoot, environmentName) : outputRoot;
|
|
1199
|
+
};
|
|
1200
|
+
const getTempRstestOutputDirGlob = (distPathRoot)=>{
|
|
1201
|
+
const outputRoot = normalize(distPathRoot);
|
|
1202
|
+
if (isAbsolute(outputRoot)) return outputRoot;
|
|
1203
|
+
return `**/${outputRoot.replace(/^\.?\//, '')}`;
|
|
1204
|
+
};
|
|
1205
|
+
const DEFAULT_CONFIG_EXTENSIONS = [
|
|
1206
|
+
'.mts',
|
|
1207
|
+
'.mjs',
|
|
1208
|
+
'.ts',
|
|
1209
|
+
'.js',
|
|
1210
|
+
'.cjs',
|
|
1211
|
+
'.cts'
|
|
1212
|
+
];
|
|
1213
|
+
const globalApis = [
|
|
1214
|
+
'test',
|
|
1215
|
+
'describe',
|
|
1216
|
+
'it',
|
|
1217
|
+
'expect',
|
|
1218
|
+
'afterAll',
|
|
1219
|
+
'afterEach',
|
|
1220
|
+
'beforeAll',
|
|
1221
|
+
'beforeEach',
|
|
1222
|
+
'rstest',
|
|
1223
|
+
'rs',
|
|
1224
|
+
'assert',
|
|
1225
|
+
'onTestFinished',
|
|
1226
|
+
'onTestFailed'
|
|
1227
|
+
];
|
|
1228
|
+
const TS_CONFIG_FILE = 'tsconfig.json';
|
|
1183
1229
|
const formatRootStr = (rootStr, root)=>rootStr.includes('<rootDir>') ? normalize(rootStr.replace('<rootDir>', normalize(root))) : rootStr;
|
|
1184
1230
|
function getAbsolutePath(base, filepath) {
|
|
1185
1231
|
return isAbsolute(filepath) ? filepath : join(base, filepath);
|
|
@@ -1228,7 +1274,7 @@ const prettyTime = (milliseconds)=>{
|
|
|
1228
1274
|
return time;
|
|
1229
1275
|
};
|
|
1230
1276
|
const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
|
|
1231
|
-
const getTaskNameWithPrefix = (test, delimiter =
|
|
1277
|
+
const getTaskNameWithPrefix = (test, delimiter = TEST_DELIMITER)=>getTaskNames(test).join(delimiter ? ` ${delimiter} ` : ' ');
|
|
1232
1278
|
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
1233
1279
|
const wrapRegex = (value)=>`${REGEXP_FLAG_PREFIX}${value.toString()}`;
|
|
1234
1280
|
const serializableConfig = (normalizedConfig)=>{
|
|
@@ -1283,14 +1329,20 @@ const isDebug = ()=>{
|
|
|
1283
1329
|
'*'
|
|
1284
1330
|
].some((key)=>values.includes(key));
|
|
1285
1331
|
};
|
|
1286
|
-
|
|
1287
|
-
const userSetColorEnv = void 0 !== process.env.FORCE_COLOR || void 0 !== process.env.NO_COLOR;
|
|
1288
|
-
|
|
1332
|
+
function getForceColorEnv(options) {
|
|
1333
|
+
const userSetColorEnv = options?.userSetColorEnv ?? (void 0 !== process.env.FORCE_COLOR || void 0 !== process.env.NO_COLOR);
|
|
1334
|
+
const agent = options?.isAgent ?? determineAgent().isAgent;
|
|
1335
|
+
const colorSupported = options?.isColorSupported ?? picocolors.isColorSupported;
|
|
1336
|
+
if (userSetColorEnv) return {};
|
|
1337
|
+
if (agent) return {
|
|
1289
1338
|
NO_COLOR: '1',
|
|
1290
1339
|
FORCE_COLOR: '0'
|
|
1291
1340
|
};
|
|
1341
|
+
if (colorSupported) return {
|
|
1342
|
+
FORCE_COLOR: '1'
|
|
1343
|
+
};
|
|
1292
1344
|
return {};
|
|
1293
|
-
}
|
|
1345
|
+
}
|
|
1294
1346
|
const logger_color = (0, picocolors.createColors)();
|
|
1295
1347
|
if (isDebug()) src_logger.level = 'verbose';
|
|
1296
1348
|
function getTime() {
|
|
@@ -1317,4 +1369,4 @@ const logger_logger = {
|
|
|
1317
1369
|
console.error(message, ...args);
|
|
1318
1370
|
}
|
|
1319
1371
|
};
|
|
1320
|
-
export { ADDITIONAL_NODE_BUILTINS, _path, basename, bgColor, castArray, clearScreen, determineAgent, dirname, dist_m, formatError, formatRootStr, getAbsolutePath, getForceColorEnv, getTaskNameWithPrefix, isAbsolute, isDebug, isDeno, isObject, isTTY, join, logger_color as color, logger_logger as logger, needFlagExperimentalDetectModule, normalize, parsePosix, prettyTime, relative, resolve, serializableConfig };
|
|
1372
|
+
export { ADDITIONAL_NODE_BUILTINS, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, POINTER, ROOT_SUITE_NAME, TEMP_RSTEST_OUTPUT_DIR, TEST_DELIMITER, TS_CONFIG_FILE, _path, basename, bgColor, castArray, clearScreen, determineAgent, dirname, dist_m, formatError, formatRootStr, getAbsolutePath, getForceColorEnv, getOutputDistPathRoot, getTaskNameWithPrefix, getTempRstestOutputDir, getTempRstestOutputDirGlob, globalApis, isAbsolute, isDebug, isDeno, isObject, isTTY, join, logger_color as color, logger_logger as logger, needFlagExperimentalDetectModule, normalize, parsePosix, prettyTime, relative, resolve, serializableConfig };
|