@rstest/core 0.2.1 → 0.2.2
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/dist/{72.js → 171.js} +2 -1
- package/dist/{920.js → 33.js} +35 -32
- package/dist/{44.js → 350.js} +6 -5
- package/dist/{813.js → 607.js} +16 -15
- package/dist/{208.js → 655.js} +60 -59
- package/dist/{359.js → 698.js} +74 -66
- package/dist/{355.js → 704.js} +17 -16
- package/dist/{965.js → 711.js} +6 -5
- package/dist/{443.js → 755.js} +2 -1
- package/dist/{723.js → 829.js} +5 -4
- package/dist/{867.js → 85.js} +56 -55
- package/dist/{668.js → 928.js} +3 -2
- package/dist/{25.js → 967.js} +8 -7
- package/dist/{64.js → 969.js} +2 -1
- package/dist/{285.js → 971.js} +12 -11
- package/dist/{854.js → 985.js} +14 -13
- package/dist/index.js +83 -83
- package/dist/worker.js +38 -36
- package/dist-types/index.d.ts +1 -0
- package/dist-types/worker.d.ts +1 -0
- package/package.json +4 -4
- /package/dist/{208.js.LICENSE.txt → 655.js.LICENSE.txt} +0 -0
- /package/dist/{668.js.LICENSE.txt → 928.js.LICENSE.txt} +0 -0
package/dist/{359.js → 698.js}
RENAMED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "698";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"698"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8
9
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
10
|
+
q: ()=>parse
|
|
10
11
|
});
|
|
11
12
|
var UNKNOWN_FUNCTION = '<unknown>';
|
|
12
13
|
function parse(stackString) {
|
|
@@ -300,7 +301,7 @@ export const __webpack_modules__ = {
|
|
|
300
301
|
const summary = [];
|
|
301
302
|
for (const module of this.runningModules){
|
|
302
303
|
const relativePath = (0, external_pathe_.relative)(this.rootPath, module);
|
|
303
|
-
summary.push(`${utils
|
|
304
|
+
summary.push(`${utils.yW.bgYellow(utils.yW.bold(' RUNS '))} ${(0, utils.EQ)(relativePath)}`);
|
|
304
305
|
}
|
|
305
306
|
summary.push('');
|
|
306
307
|
return summary;
|
|
@@ -319,52 +320,52 @@ export const __webpack_modules__ = {
|
|
|
319
320
|
}
|
|
320
321
|
}
|
|
321
322
|
const getSummaryStatusString = (tasks, name = 'tests', showTotal = true)=>{
|
|
322
|
-
if (0 === tasks.length) return utils
|
|
323
|
+
if (0 === tasks.length) return utils.yW.dim(`no ${name}`);
|
|
323
324
|
const passed = tasks.filter((result)=>'pass' === result.status);
|
|
324
325
|
const failed = tasks.filter((result)=>'fail' === result.status);
|
|
325
326
|
const skipped = tasks.filter((result)=>'skip' === result.status);
|
|
326
327
|
const todo = tasks.filter((result)=>'todo' === result.status);
|
|
327
328
|
const status = [
|
|
328
|
-
failed.length ? utils
|
|
329
|
-
passed.length ? utils
|
|
330
|
-
skipped.length ? utils
|
|
331
|
-
todo.length ? utils
|
|
329
|
+
failed.length ? utils.yW.bold(utils.yW.red(`${failed.length} failed`)) : null,
|
|
330
|
+
passed.length ? utils.yW.bold(utils.yW.green(`${passed.length} passed`)) : null,
|
|
331
|
+
skipped.length ? utils.yW.yellow(`${skipped.length} skipped`) : null,
|
|
332
|
+
todo.length ? utils.yW.gray(`${todo.length} todo`) : null
|
|
332
333
|
].filter(Boolean);
|
|
333
|
-
return status.join(utils
|
|
334
|
+
return status.join(utils.yW.dim(' | ')) + (showTotal && status.length > 1 ? utils.yW.gray(` (${tasks.length})`) : '');
|
|
334
335
|
};
|
|
335
336
|
const printSnapshotSummaryLog = (snapshots, rootDir)=>{
|
|
336
337
|
const summary = [];
|
|
337
|
-
if (snapshots.added) summary.push(utils
|
|
338
|
-
if (snapshots.unmatched) summary.push(utils
|
|
339
|
-
if (snapshots.updated) summary.push(utils
|
|
340
|
-
if (snapshots.filesRemoved) if (snapshots.didUpdate) summary.push(utils
|
|
341
|
-
else summary.push(utils
|
|
338
|
+
if (snapshots.added) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.added} written`)));
|
|
339
|
+
if (snapshots.unmatched) summary.push(utils.yW.bold(utils.yW.red(`${snapshots.unmatched} failed`)));
|
|
340
|
+
if (snapshots.updated) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.updated} updated `)));
|
|
341
|
+
if (snapshots.filesRemoved) if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.filesRemoved} files removed `)));
|
|
342
|
+
else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.filesRemoved} files obsolete `)));
|
|
342
343
|
const POINTER = "\u279C";
|
|
343
344
|
if (snapshots.filesRemovedList?.length) {
|
|
344
345
|
const [head, ...tail] = snapshots.filesRemovedList;
|
|
345
|
-
summary.push(`${utils
|
|
346
|
-
for (const key of tail)summary.push(` ${(0, utils.
|
|
346
|
+
summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, head)}`);
|
|
347
|
+
for (const key of tail)summary.push(` ${(0, utils.XJ)(rootDir, key)}`);
|
|
347
348
|
}
|
|
348
349
|
if (snapshots.unchecked) {
|
|
349
|
-
if (snapshots.didUpdate) summary.push(utils
|
|
350
|
-
else summary.push(utils
|
|
350
|
+
if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.unchecked} removed`)));
|
|
351
|
+
else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.unchecked} obsolete`)));
|
|
351
352
|
for (const uncheckedFile of snapshots.uncheckedKeysByFile){
|
|
352
|
-
summary.push(`${utils
|
|
353
|
+
summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, uncheckedFile.filePath)}`);
|
|
353
354
|
for (const key of uncheckedFile.keys)summary.push(` ${key}`);
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
for (const [index, snapshot] of summary.entries()){
|
|
357
358
|
const title = 0 === index ? 'Snapshots' : '';
|
|
358
|
-
utils.
|
|
359
|
+
utils.vF.log(`${utils.yW.gray(title.padStart(12))} ${snapshot}`);
|
|
359
360
|
}
|
|
360
361
|
};
|
|
361
362
|
const printSummaryLog = ({ results, testResults, snapshotSummary, duration, rootPath })=>{
|
|
362
|
-
utils.
|
|
363
|
+
utils.vF.log('');
|
|
363
364
|
printSnapshotSummaryLog(snapshotSummary, rootPath);
|
|
364
|
-
utils.
|
|
365
|
-
utils.
|
|
366
|
-
utils.
|
|
367
|
-
utils.
|
|
365
|
+
utils.vF.log(`${utils.yW.gray('Test Files'.padStart(11))} ${getSummaryStatusString(results)}`);
|
|
366
|
+
utils.vF.log(`${utils.yW.gray('Tests'.padStart(11))} ${getSummaryStatusString(testResults)}`);
|
|
367
|
+
utils.vF.log(`${utils.yW.gray('Duration'.padStart(11))} ${(0, utils.kV)(duration.totalTime)} ${utils.yW.gray(`(build ${(0, utils.kV)(duration.buildTime)}, tests ${(0, utils.kV)(duration.testTime)})`)}`);
|
|
368
|
+
utils.vF.log('');
|
|
368
369
|
};
|
|
369
370
|
const printSummaryErrorLogs = async ({ testResults, results, rootPath, getSourcemap })=>{
|
|
370
371
|
const failedTests = [
|
|
@@ -372,17 +373,17 @@ export const __webpack_modules__ = {
|
|
|
372
373
|
...testResults.filter((i)=>'fail' === i.status)
|
|
373
374
|
];
|
|
374
375
|
if (0 === failedTests.length) return;
|
|
375
|
-
utils.
|
|
376
|
-
utils.
|
|
377
|
-
utils.
|
|
376
|
+
utils.vF.log('');
|
|
377
|
+
utils.vF.log(utils.yW.bold('Summary of all failing tests:'));
|
|
378
|
+
utils.vF.log('');
|
|
378
379
|
for (const test of failedTests){
|
|
379
380
|
const relativePath = external_pathe_["default"].relative(rootPath, test.testPath);
|
|
380
|
-
const nameStr = (0, utils.
|
|
381
|
-
utils.
|
|
381
|
+
const nameStr = (0, utils.fN)(test);
|
|
382
|
+
utils.vF.log(`${utils.yW.bgRed(' FAIL ')} ${(0, utils.EQ)(relativePath)} ${nameStr.length ? `${utils.yW.dim(utils.vO)} ${nameStr}` : ''}`);
|
|
382
383
|
if (test.errors) {
|
|
383
384
|
const { printError } = await Promise.all([
|
|
384
|
-
__webpack_require__.e("
|
|
385
|
-
__webpack_require__.e("
|
|
385
|
+
__webpack_require__.e("829"),
|
|
386
|
+
__webpack_require__.e("704")
|
|
386
387
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
|
|
387
388
|
for (const error of test.errors)await printError(error, getSourcemap, rootPath);
|
|
388
389
|
}
|
|
@@ -395,27 +396,27 @@ export const __webpack_modules__ = {
|
|
|
395
396
|
skip: '-'
|
|
396
397
|
};
|
|
397
398
|
const statusColorfulStr = {
|
|
398
|
-
fail: utils
|
|
399
|
-
pass: utils
|
|
400
|
-
todo: utils
|
|
401
|
-
skip: utils
|
|
399
|
+
fail: utils.yW.red(statusStr.fail),
|
|
400
|
+
pass: utils.yW.green(statusStr.pass),
|
|
401
|
+
todo: utils.yW.gray(statusStr.todo),
|
|
402
|
+
skip: utils.yW.gray(statusStr.skip)
|
|
402
403
|
};
|
|
403
404
|
const logCase = (result, slowTestThreshold)=>{
|
|
404
405
|
const isSlowCase = (result.duration || 0) > slowTestThreshold;
|
|
405
|
-
const icon = isSlowCase && 'pass' === result.status ? utils
|
|
406
|
-
const nameStr = (0, utils.
|
|
407
|
-
const duration = void 0 !== result.duration ? ` (${(0, utils.
|
|
408
|
-
const retry = result.retryCount ? utils
|
|
409
|
-
utils.
|
|
410
|
-
if (result.errors) for (const error of result.errors)console.error(utils
|
|
406
|
+
const icon = isSlowCase && 'pass' === result.status ? utils.yW.yellow(statusStr[result.status]) : statusColorfulStr[result.status];
|
|
407
|
+
const nameStr = (0, utils.fN)(result);
|
|
408
|
+
const duration = void 0 !== result.duration ? ` (${(0, utils.kV)(result.duration)})` : '';
|
|
409
|
+
const retry = result.retryCount ? utils.yW.yellow(` (retry x${result.retryCount})`) : '';
|
|
410
|
+
utils.vF.log(` ${icon} ${nameStr}${utils.yW.gray(duration)}${retry}`);
|
|
411
|
+
if (result.errors) for (const error of result.errors)console.error(utils.yW.red(` ${error.message}`));
|
|
411
412
|
};
|
|
412
413
|
const logFileTitle = (test, relativePath, slowTestThreshold, alwaysShowTime = false)=>{
|
|
413
|
-
let title = ` ${utils
|
|
414
|
-
const formatDuration = (duration)=>utils
|
|
415
|
-
title += ` ${utils
|
|
414
|
+
let title = ` ${utils.yW.bold(statusColorfulStr[test.status])} ${(0, utils.EQ)(relativePath)}`;
|
|
415
|
+
const formatDuration = (duration)=>utils.yW[duration > slowTestThreshold ? 'yellow' : 'green']((0, utils.kV)(duration));
|
|
416
|
+
title += ` ${utils.yW.gray(`(${test.results.length})`)}`;
|
|
416
417
|
const isTooSlow = test.duration && test.duration > slowTestThreshold;
|
|
417
418
|
if (alwaysShowTime || isTooSlow) title += ` ${formatDuration(test.duration)}`;
|
|
418
|
-
utils.
|
|
419
|
+
utils.vF.log(title);
|
|
419
420
|
};
|
|
420
421
|
class DefaultReporter {
|
|
421
422
|
rootPath;
|
|
@@ -455,14 +456,14 @@ export const __webpack_modules__ = {
|
|
|
455
456
|
];
|
|
456
457
|
const testPath = (0, external_pathe_.relative)(this.rootPath, log.testPath);
|
|
457
458
|
if (log.trace) {
|
|
458
|
-
const [frame] = (0, stack_trace_parser_esm.
|
|
459
|
+
const [frame] = (0, stack_trace_parser_esm.q)(log.trace);
|
|
459
460
|
const filePath = (0, external_pathe_.relative)(this.rootPath, frame.file || '');
|
|
460
|
-
if (filePath !== testPath) titles.push((0, utils.
|
|
461
|
-
titles.push((0, utils.
|
|
462
|
-
} else titles.push((0, utils.
|
|
463
|
-
utils.
|
|
464
|
-
utils.
|
|
465
|
-
utils.
|
|
461
|
+
if (filePath !== testPath) titles.push((0, utils.EQ)(testPath));
|
|
462
|
+
titles.push((0, utils.EQ)(filePath) + utils.yW.gray(`:${frame.lineNumber}:${frame.column}`));
|
|
463
|
+
} else titles.push((0, utils.EQ)(testPath));
|
|
464
|
+
utils.vF.log(titles.join(utils.yW.gray(' | ')));
|
|
465
|
+
utils.vF.log(log.content);
|
|
466
|
+
utils.vF.log('');
|
|
466
467
|
}
|
|
467
468
|
async onExit() {
|
|
468
469
|
this.statusRenderer?.clear();
|
|
@@ -492,6 +493,9 @@ export const __webpack_modules__ = {
|
|
|
492
493
|
this.onWritePath = options.onWritePath;
|
|
493
494
|
this.rootPath = rootPath;
|
|
494
495
|
}
|
|
496
|
+
log(message) {
|
|
497
|
+
console.log(`${message}\n`);
|
|
498
|
+
}
|
|
495
499
|
async onTestRunEnd({ results, testResults, getSourcemap }) {
|
|
496
500
|
const failedTests = [
|
|
497
501
|
...results.filter((i)=>'fail' === i.status && i.errors?.length),
|
|
@@ -499,14 +503,15 @@ export const __webpack_modules__ = {
|
|
|
499
503
|
];
|
|
500
504
|
if (0 === failedTests.length) return;
|
|
501
505
|
const { parseErrorStacktrace } = await Promise.all([
|
|
502
|
-
__webpack_require__.e("
|
|
503
|
-
__webpack_require__.e("
|
|
506
|
+
__webpack_require__.e("829"),
|
|
507
|
+
__webpack_require__.e("704")
|
|
504
508
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
|
|
509
|
+
const logs = [];
|
|
505
510
|
for (const test of failedTests){
|
|
506
511
|
const { testPath } = test;
|
|
507
|
-
const nameStr = (0, utils.
|
|
512
|
+
const nameStr = (0, utils.fN)(test);
|
|
508
513
|
const shortPath = (0, external_pathe_.relative)(this.rootPath, testPath);
|
|
509
|
-
const title = `${shortPath} ${utils.
|
|
514
|
+
const title = `${shortPath} ${utils.vO} ${nameStr}`;
|
|
510
515
|
for (const error of test.errors || []){
|
|
511
516
|
let file = testPath;
|
|
512
517
|
let line = 1;
|
|
@@ -525,9 +530,12 @@ export const __webpack_modules__ = {
|
|
|
525
530
|
column = stackFrames[0].column || 1;
|
|
526
531
|
}
|
|
527
532
|
}
|
|
528
|
-
|
|
533
|
+
logs.push(`::${type} file=${this.onWritePath?.(file) || file},line=${line},col=${column},title=${escapeData(title)}::${escapeData(message)}`);
|
|
529
534
|
}
|
|
530
535
|
}
|
|
536
|
+
this.log('::group::error for github actions');
|
|
537
|
+
for (const log of logs)this.log(log);
|
|
538
|
+
this.log('::endgroup::');
|
|
531
539
|
}
|
|
532
540
|
}
|
|
533
541
|
function escapeData(s) {
|
|
@@ -549,7 +557,7 @@ export const __webpack_modules__ = {
|
|
|
549
557
|
'github-actions': GithubActionsReporter
|
|
550
558
|
};
|
|
551
559
|
function createReporters(reporters, initOptions = {}) {
|
|
552
|
-
const result = (0, helper.
|
|
560
|
+
const result = (0, helper.bg)(reporters).map((reporter)=>{
|
|
553
561
|
if ('string' == typeof reporter || Array.isArray(reporter)) {
|
|
554
562
|
const [name, options = {}] = 'string' == typeof reporter ? [
|
|
555
563
|
reporter,
|
|
@@ -570,8 +578,8 @@ export const __webpack_modules__ = {
|
|
|
570
578
|
}
|
|
571
579
|
function createContext(options, userConfig) {
|
|
572
580
|
const { cwd, command, fileFilters, configFilePath } = options;
|
|
573
|
-
const rootPath = userConfig.root ? (0, helper.
|
|
574
|
-
const rstestConfig = (0, src_config.
|
|
581
|
+
const rootPath = userConfig.root ? (0, helper.FI)(cwd, userConfig.root) : cwd;
|
|
582
|
+
const rstestConfig = (0, src_config.wX)(userConfig);
|
|
575
583
|
const reporters = 'list' !== command ? createReporters(rstestConfig.reporters, {
|
|
576
584
|
rootPath,
|
|
577
585
|
config: rstestConfig
|
|
@@ -582,7 +590,7 @@ export const __webpack_modules__ = {
|
|
|
582
590
|
return {
|
|
583
591
|
configFilePath,
|
|
584
592
|
command,
|
|
585
|
-
version: "0.2.
|
|
593
|
+
version: "0.2.2",
|
|
586
594
|
rootPath,
|
|
587
595
|
reporters,
|
|
588
596
|
fileFilters,
|
|
@@ -600,15 +608,15 @@ export const __webpack_modules__ = {
|
|
|
600
608
|
}, config);
|
|
601
609
|
const runTests = async ()=>{
|
|
602
610
|
const { runTests } = await Promise.all([
|
|
603
|
-
__webpack_require__.e("
|
|
604
|
-
__webpack_require__.e("
|
|
611
|
+
__webpack_require__.e("985"),
|
|
612
|
+
__webpack_require__.e("33")
|
|
605
613
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/core/runTests.ts"));
|
|
606
614
|
await runTests(context);
|
|
607
615
|
};
|
|
608
616
|
const listTests = async (options)=>{
|
|
609
617
|
const { listTests } = await Promise.all([
|
|
610
|
-
__webpack_require__.e("
|
|
611
|
-
__webpack_require__.e("
|
|
618
|
+
__webpack_require__.e("985"),
|
|
619
|
+
__webpack_require__.e("971")
|
|
612
620
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/core/listTests.ts"));
|
|
613
621
|
await listTests(context, options);
|
|
614
622
|
};
|
package/dist/{355.js → 704.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "704";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"704"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/utils/error.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -10,7 +11,7 @@ export const __webpack_modules__ = {
|
|
|
10
11
|
printError: ()=>printError
|
|
11
12
|
});
|
|
12
13
|
var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:fs");
|
|
13
|
-
var _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.
|
|
14
|
+
var _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.30/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs");
|
|
14
15
|
var stacktrace_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js");
|
|
15
16
|
var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/utils/index.ts");
|
|
16
17
|
async function printError(error, getSourcemap, rootPath) {
|
|
@@ -19,16 +20,16 @@ export const __webpack_modules__ = {
|
|
|
19
20
|
const tips = [
|
|
20
21
|
'Error: not support import `vitest` in Rstest test environment.\n',
|
|
21
22
|
'Solution:',
|
|
22
|
-
` - Update your code to use imports from "${_utils__WEBPACK_IMPORTED_MODULE_3__
|
|
23
|
+
` - Update your code to use imports from "${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.yellow('@rstest/core')}" instead of "${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.yellow('vitest')}".`,
|
|
23
24
|
' - Enable `globals` configuration and use global API.'
|
|
24
25
|
];
|
|
25
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
26
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(`${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.red(tips.join('\n'))}\n`);
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
29
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(`${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.red(_utils__WEBPACK_IMPORTED_MODULE_3__.yW.bold(errorName))}${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.red(`: ${error.message}`)}\n`);
|
|
29
30
|
if (error.diff) {
|
|
30
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
31
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
31
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(error.diff);
|
|
32
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log();
|
|
32
33
|
}
|
|
33
34
|
if (error.stack) {
|
|
34
35
|
const stackFrames = await parseErrorStacktrace({
|
|
@@ -45,7 +46,7 @@ export const __webpack_modules__ = {
|
|
|
45
46
|
if (!filePath) return;
|
|
46
47
|
const source = node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].existsSync(filePath) ? node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].readFileSync(filePath, 'utf-8') : void 0;
|
|
47
48
|
if (!source) return;
|
|
48
|
-
const { codeFrameColumns } = await __webpack_require__.e("
|
|
49
|
+
const { codeFrameColumns } = await __webpack_require__.e("171").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"));
|
|
49
50
|
const result = codeFrameColumns(source, {
|
|
50
51
|
start: {
|
|
51
52
|
line: frame.lineNumber,
|
|
@@ -55,15 +56,15 @@ export const __webpack_modules__ = {
|
|
|
55
56
|
highlightCode: true,
|
|
56
57
|
linesBelow: 2
|
|
57
58
|
});
|
|
58
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
59
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
59
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(result);
|
|
60
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log('');
|
|
60
61
|
}
|
|
61
62
|
function printStack(stackFrames, rootPath) {
|
|
62
63
|
for (const frame of stackFrames){
|
|
63
|
-
const msg = '<unknown>' !== frame.methodName ? `at ${frame.methodName} (${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
64
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
64
|
+
const msg = '<unknown>' !== frame.methodName ? `at ${frame.methodName} (${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.XJ)(rootPath, frame.file)}:${frame.lineNumber}:${frame.column})` : `at ${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.XJ)(rootPath, frame.file)}:${frame.lineNumber}:${frame.column}`;
|
|
65
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(_utils__WEBPACK_IMPORTED_MODULE_3__.yW.gray(` ${msg}`));
|
|
65
66
|
}
|
|
66
|
-
stackFrames.length && _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
67
|
+
stackFrames.length && _utils__WEBPACK_IMPORTED_MODULE_3__.vF.log();
|
|
67
68
|
}
|
|
68
69
|
const stackIgnores = [
|
|
69
70
|
/\/@rstest\/core/,
|
|
@@ -78,11 +79,11 @@ export const __webpack_modules__ = {
|
|
|
78
79
|
'<anonymous>'
|
|
79
80
|
];
|
|
80
81
|
async function parseErrorStacktrace({ stack, getSourcemap, fullStack }) {
|
|
81
|
-
return Promise.all((0, stacktrace_parser__WEBPACK_IMPORTED_MODULE_2__.
|
|
82
|
+
return Promise.all((0, stacktrace_parser__WEBPACK_IMPORTED_MODULE_2__.q)(stack).filter((frame)=>fullStack ? true : frame.file && !stackIgnores.some((entry)=>frame.file?.match(entry))).map(async (frame)=>{
|
|
82
83
|
const sourcemap = getSourcemap(frame.file);
|
|
83
84
|
if (sourcemap) {
|
|
84
|
-
const traceMap = new _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__.
|
|
85
|
-
const { line, column, source, name } = (0, _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__.
|
|
85
|
+
const traceMap = new _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__.YX(sourcemap);
|
|
86
|
+
const { line, column, source, name } = (0, _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_1__.sP)(traceMap, {
|
|
86
87
|
line: frame.lineNumber,
|
|
87
88
|
column: frame.column
|
|
88
89
|
});
|
package/dist/{965.js → 711.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "711";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"711"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/runtime/worker/env/jsdom.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -28,8 +29,8 @@ export const __webpack_modules__ = {
|
|
|
28
29
|
userAgent,
|
|
29
30
|
...restOptions
|
|
30
31
|
});
|
|
31
|
-
const cleanupGlobal = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.
|
|
32
|
-
const cleanupHandler = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.
|
|
32
|
+
const cleanupGlobal = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.p5)(global, dom.window);
|
|
33
|
+
const cleanupHandler = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.d1)(global);
|
|
33
34
|
return {
|
|
34
35
|
teardown () {
|
|
35
36
|
cleanupHandler();
|
|
@@ -42,8 +43,8 @@ export const __webpack_modules__ = {
|
|
|
42
43
|
},
|
|
43
44
|
"./src/runtime/worker/env/utils.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
44
45
|
__webpack_require__.d(__webpack_exports__, {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
d1: ()=>addDefaultErrorHandler,
|
|
47
|
+
p5: ()=>installGlobal
|
|
47
48
|
});
|
|
48
49
|
const LIVING_KEYS = [
|
|
49
50
|
'DOMException',
|
package/dist/{443.js → 755.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "755";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"755"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"../../node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
package/dist/{723.js → 829.js}
RENAMED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "829";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"829"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
|
-
"../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.
|
|
8
|
+
"../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.30/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
8
9
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
YX: ()=>TraceMap,
|
|
11
|
+
sP: ()=>originalPositionFor
|
|
11
12
|
});
|
|
12
13
|
const comma = ','.charCodeAt(0);
|
|
13
14
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|