@rstest/core 0.5.2 → 0.5.3
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/0~85.js +0 -3
- package/dist/index.js +111 -94
- package/dist/worker.js +3 -3
- package/dist-types/index.d.ts +6 -3
- package/dist-types/worker.d.ts +6 -3
- package/package.json +1 -1
package/dist/0~85.js
CHANGED
|
@@ -621,9 +621,6 @@ export const __webpack_modules__ = {
|
|
|
621
621
|
const results = [];
|
|
622
622
|
const errors = [];
|
|
623
623
|
let defaultStatus = 'pass';
|
|
624
|
-
hooks.onTestFileStart?.({
|
|
625
|
-
testPath
|
|
626
|
-
});
|
|
627
624
|
const snapshotClient = getSnapshotClient();
|
|
628
625
|
await snapshotClient.setup(testPath, snapshotOptions);
|
|
629
626
|
const runTestsCase = async (test, parentHooks)=>{
|
package/dist/index.js
CHANGED
|
@@ -2108,7 +2108,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2108
2108
|
function setupCommands() {
|
|
2109
2109
|
const cli = dist('rstest');
|
|
2110
2110
|
cli.help();
|
|
2111
|
-
cli.version("0.5.
|
|
2111
|
+
cli.version("0.5.3");
|
|
2112
2112
|
applyCommonOptions(cli);
|
|
2113
2113
|
cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
|
|
2114
2114
|
(0, prepare.N)();
|
|
@@ -2347,7 +2347,7 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
2347
2347
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
|
|
2348
2348
|
}
|
|
2349
2349
|
function showRstest() {
|
|
2350
|
-
_utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.5.
|
|
2350
|
+
_utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.5.3");
|
|
2351
2351
|
_utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.log('');
|
|
2352
2352
|
}
|
|
2353
2353
|
},
|
|
@@ -2889,6 +2889,77 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
2889
2889
|
var src_config = __webpack_require__("./src/config.ts");
|
|
2890
2890
|
var stack_trace_parser_esm = __webpack_require__("../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js");
|
|
2891
2891
|
var utils = __webpack_require__("./src/utils/index.ts");
|
|
2892
|
+
var dist = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs");
|
|
2893
|
+
const getSummaryStatusString = (tasks, name = 'tests', showTotal = true)=>{
|
|
2894
|
+
if (0 === tasks.length) return utils.yW.dim(`no ${name}`);
|
|
2895
|
+
const passed = tasks.filter((result)=>'pass' === result.status);
|
|
2896
|
+
const failed = tasks.filter((result)=>'fail' === result.status);
|
|
2897
|
+
const skipped = tasks.filter((result)=>'skip' === result.status);
|
|
2898
|
+
const todo = tasks.filter((result)=>'todo' === result.status);
|
|
2899
|
+
const status = [
|
|
2900
|
+
failed.length ? utils.yW.bold(utils.yW.red(`${failed.length} failed`)) : null,
|
|
2901
|
+
passed.length ? utils.yW.bold(utils.yW.green(`${passed.length} passed`)) : null,
|
|
2902
|
+
skipped.length ? utils.yW.yellow(`${skipped.length} skipped`) : null,
|
|
2903
|
+
todo.length ? utils.yW.gray(`${todo.length} todo`) : null
|
|
2904
|
+
].filter(Boolean);
|
|
2905
|
+
return status.join(utils.yW.dim(' | ')) + (showTotal && status.length > 1 ? utils.yW.gray(` (${tasks.length})`) : '');
|
|
2906
|
+
};
|
|
2907
|
+
const printSnapshotSummaryLog = (snapshots, rootDir)=>{
|
|
2908
|
+
const summary = [];
|
|
2909
|
+
if (snapshots.added) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.added} written`)));
|
|
2910
|
+
if (snapshots.unmatched) summary.push(utils.yW.bold(utils.yW.red(`${snapshots.unmatched} failed`)));
|
|
2911
|
+
if (snapshots.updated) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.updated} updated `)));
|
|
2912
|
+
if (snapshots.filesRemoved) if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.filesRemoved} files removed `)));
|
|
2913
|
+
else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.filesRemoved} files obsolete `)));
|
|
2914
|
+
const POINTER = '➜';
|
|
2915
|
+
if (snapshots.filesRemovedList?.length) {
|
|
2916
|
+
const [head, ...tail] = snapshots.filesRemovedList;
|
|
2917
|
+
summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, head)}`);
|
|
2918
|
+
for (const key of tail)summary.push(` ${(0, utils.XJ)(rootDir, key)}`);
|
|
2919
|
+
}
|
|
2920
|
+
if (snapshots.unchecked) {
|
|
2921
|
+
if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.unchecked} removed`)));
|
|
2922
|
+
else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.unchecked} obsolete`)));
|
|
2923
|
+
for (const uncheckedFile of snapshots.uncheckedKeysByFile){
|
|
2924
|
+
summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, uncheckedFile.filePath)}`);
|
|
2925
|
+
for (const key of uncheckedFile.keys)summary.push(` ${key}`);
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
for (const [index, snapshot] of summary.entries()){
|
|
2929
|
+
const title = 0 === index ? 'Snapshots' : '';
|
|
2930
|
+
utils.vF.log(`${utils.yW.gray(title.padStart(12))} ${snapshot}`);
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
const TestFileSummaryLabel = utils.yW.gray('Test Files'.padStart(11));
|
|
2934
|
+
const TestSummaryLabel = utils.yW.gray('Tests'.padStart(11));
|
|
2935
|
+
const DurationLabel = utils.yW.gray('Duration'.padStart(11));
|
|
2936
|
+
const printSummaryLog = ({ results, testResults, snapshotSummary, duration, rootPath })=>{
|
|
2937
|
+
utils.vF.log('');
|
|
2938
|
+
printSnapshotSummaryLog(snapshotSummary, rootPath);
|
|
2939
|
+
utils.vF.log(`${TestFileSummaryLabel} ${getSummaryStatusString(results)}`);
|
|
2940
|
+
utils.vF.log(`${TestSummaryLabel} ${getSummaryStatusString(testResults)}`);
|
|
2941
|
+
utils.vF.log(`${DurationLabel} ${(0, utils.kV)(duration.totalTime)} ${utils.yW.gray(`(build ${(0, utils.kV)(duration.buildTime)}, tests ${(0, utils.kV)(duration.testTime)})`)}`);
|
|
2942
|
+
utils.vF.log('');
|
|
2943
|
+
};
|
|
2944
|
+
const printSummaryErrorLogs = async ({ testResults, results, rootPath, getSourcemap, filterRerunTestPaths })=>{
|
|
2945
|
+
const failedTests = [
|
|
2946
|
+
...results.filter((i)=>'fail' === i.status && i.errors?.length && (filterRerunTestPaths ? filterRerunTestPaths.includes(i.testPath) : true)),
|
|
2947
|
+
...testResults.filter((i)=>'fail' === i.status && (filterRerunTestPaths ? filterRerunTestPaths.includes(i.testPath) : true))
|
|
2948
|
+
];
|
|
2949
|
+
if (0 === failedTests.length) return;
|
|
2950
|
+
utils.vF.log('');
|
|
2951
|
+
utils.vF.log(utils.yW.bold('Summary of all failing tests:'));
|
|
2952
|
+
utils.vF.log('');
|
|
2953
|
+
for (const test of failedTests){
|
|
2954
|
+
const relativePath = dist.Ay.relative(rootPath, test.testPath);
|
|
2955
|
+
const nameStr = (0, utils.fN)(test);
|
|
2956
|
+
utils.vF.log(`${utils.yW.bgRed(' FAIL ')} ${(0, utils.EQ)(relativePath)} ${nameStr.length ? `${utils.yW.dim(utils.vO)} ${nameStr}` : ''}`);
|
|
2957
|
+
if (test.errors) {
|
|
2958
|
+
const { printError } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
|
|
2959
|
+
for (const error of test.errors)await printError(error, getSourcemap, rootPath);
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2892
2963
|
const DEFAULT_RENDER_INTERVAL_MS = 1000;
|
|
2893
2964
|
const ESC = '\x1B[';
|
|
2894
2965
|
const CLEAR_LINE = `${ESC}K`;
|
|
@@ -3009,7 +3080,9 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
3009
3080
|
class StatusRenderer {
|
|
3010
3081
|
rootPath;
|
|
3011
3082
|
renderer;
|
|
3012
|
-
runningModules = new
|
|
3083
|
+
runningModules = new Map();
|
|
3084
|
+
testModules = [];
|
|
3085
|
+
startTime = void 0;
|
|
3013
3086
|
constructor(rootPath){
|
|
3014
3087
|
this.rootPath = rootPath;
|
|
3015
3088
|
this.renderer = new WindowRenderer({
|
|
@@ -3022,95 +3095,43 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
3022
3095
|
});
|
|
3023
3096
|
}
|
|
3024
3097
|
getContent() {
|
|
3098
|
+
this.startTime ??= Date.now();
|
|
3025
3099
|
const summary = [];
|
|
3026
|
-
for (const module of this.runningModules){
|
|
3100
|
+
for (const module of this.runningModules.keys()){
|
|
3027
3101
|
const relativePath = (0, pathe_M_eThtNZ.b)(this.rootPath, module);
|
|
3028
3102
|
summary.push(`${utils.yW.bgYellow(utils.yW.bold(' RUNS '))} ${(0, utils.EQ)(relativePath)}`);
|
|
3029
3103
|
}
|
|
3030
3104
|
summary.push('');
|
|
3105
|
+
if (0 === this.testModules.length) summary.push(`${TestFileSummaryLabel} ${this.runningModules.size} total`);
|
|
3106
|
+
else summary.push(`${TestFileSummaryLabel} ${getSummaryStatusString(this.testModules, '', false)} ${utils.yW.dim('|')} ${this.runningModules.size + this.testModules.length} total`);
|
|
3107
|
+
const testResults = Array.from(this.runningModules.values()).flat().concat(this.testModules.flatMap((mod)=>mod.results));
|
|
3108
|
+
if (testResults.length) summary.push(`${TestSummaryLabel} ${getSummaryStatusString(testResults, '', false)}`);
|
|
3109
|
+
summary.push(`${DurationLabel} ${(0, utils.kV)(Date.now() - this.startTime)}`);
|
|
3110
|
+
summary.push('');
|
|
3031
3111
|
return summary;
|
|
3032
3112
|
}
|
|
3033
|
-
|
|
3034
|
-
this.runningModules.
|
|
3113
|
+
onTestFileStart(testPath) {
|
|
3114
|
+
this.runningModules.set(testPath, []);
|
|
3035
3115
|
this.renderer?.schedule();
|
|
3036
3116
|
}
|
|
3037
|
-
|
|
3038
|
-
this.runningModules.
|
|
3117
|
+
onTestCaseResult(result) {
|
|
3118
|
+
this.runningModules.set(result.testPath, [
|
|
3119
|
+
...this.runningModules.get(result.testPath) || [],
|
|
3120
|
+
result
|
|
3121
|
+
]);
|
|
3122
|
+
}
|
|
3123
|
+
onTestFileResult(test) {
|
|
3124
|
+
this.runningModules.delete(test.testPath);
|
|
3125
|
+
this.testModules.push(test);
|
|
3039
3126
|
this.renderer?.schedule();
|
|
3040
3127
|
}
|
|
3041
3128
|
clear() {
|
|
3129
|
+
this.testModules.length = 0;
|
|
3042
3130
|
this.runningModules.clear();
|
|
3131
|
+
this.startTime = void 0;
|
|
3043
3132
|
this.renderer?.finish();
|
|
3044
3133
|
}
|
|
3045
3134
|
}
|
|
3046
|
-
var dist = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs");
|
|
3047
|
-
const getSummaryStatusString = (tasks, name = 'tests', showTotal = true)=>{
|
|
3048
|
-
if (0 === tasks.length) return utils.yW.dim(`no ${name}`);
|
|
3049
|
-
const passed = tasks.filter((result)=>'pass' === result.status);
|
|
3050
|
-
const failed = tasks.filter((result)=>'fail' === result.status);
|
|
3051
|
-
const skipped = tasks.filter((result)=>'skip' === result.status);
|
|
3052
|
-
const todo = tasks.filter((result)=>'todo' === result.status);
|
|
3053
|
-
const status = [
|
|
3054
|
-
failed.length ? utils.yW.bold(utils.yW.red(`${failed.length} failed`)) : null,
|
|
3055
|
-
passed.length ? utils.yW.bold(utils.yW.green(`${passed.length} passed`)) : null,
|
|
3056
|
-
skipped.length ? utils.yW.yellow(`${skipped.length} skipped`) : null,
|
|
3057
|
-
todo.length ? utils.yW.gray(`${todo.length} todo`) : null
|
|
3058
|
-
].filter(Boolean);
|
|
3059
|
-
return status.join(utils.yW.dim(' | ')) + (showTotal && status.length > 1 ? utils.yW.gray(` (${tasks.length})`) : '');
|
|
3060
|
-
};
|
|
3061
|
-
const printSnapshotSummaryLog = (snapshots, rootDir)=>{
|
|
3062
|
-
const summary = [];
|
|
3063
|
-
if (snapshots.added) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.added} written`)));
|
|
3064
|
-
if (snapshots.unmatched) summary.push(utils.yW.bold(utils.yW.red(`${snapshots.unmatched} failed`)));
|
|
3065
|
-
if (snapshots.updated) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.updated} updated `)));
|
|
3066
|
-
if (snapshots.filesRemoved) if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.filesRemoved} files removed `)));
|
|
3067
|
-
else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.filesRemoved} files obsolete `)));
|
|
3068
|
-
const POINTER = '➜';
|
|
3069
|
-
if (snapshots.filesRemovedList?.length) {
|
|
3070
|
-
const [head, ...tail] = snapshots.filesRemovedList;
|
|
3071
|
-
summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, head)}`);
|
|
3072
|
-
for (const key of tail)summary.push(` ${(0, utils.XJ)(rootDir, key)}`);
|
|
3073
|
-
}
|
|
3074
|
-
if (snapshots.unchecked) {
|
|
3075
|
-
if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.unchecked} removed`)));
|
|
3076
|
-
else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.unchecked} obsolete`)));
|
|
3077
|
-
for (const uncheckedFile of snapshots.uncheckedKeysByFile){
|
|
3078
|
-
summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, uncheckedFile.filePath)}`);
|
|
3079
|
-
for (const key of uncheckedFile.keys)summary.push(` ${key}`);
|
|
3080
|
-
}
|
|
3081
|
-
}
|
|
3082
|
-
for (const [index, snapshot] of summary.entries()){
|
|
3083
|
-
const title = 0 === index ? 'Snapshots' : '';
|
|
3084
|
-
utils.vF.log(`${utils.yW.gray(title.padStart(12))} ${snapshot}`);
|
|
3085
|
-
}
|
|
3086
|
-
};
|
|
3087
|
-
const printSummaryLog = ({ results, testResults, snapshotSummary, duration, rootPath })=>{
|
|
3088
|
-
utils.vF.log('');
|
|
3089
|
-
printSnapshotSummaryLog(snapshotSummary, rootPath);
|
|
3090
|
-
utils.vF.log(`${utils.yW.gray('Test Files'.padStart(11))} ${getSummaryStatusString(results)}`);
|
|
3091
|
-
utils.vF.log(`${utils.yW.gray('Tests'.padStart(11))} ${getSummaryStatusString(testResults)}`);
|
|
3092
|
-
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)})`)}`);
|
|
3093
|
-
utils.vF.log('');
|
|
3094
|
-
};
|
|
3095
|
-
const printSummaryErrorLogs = async ({ testResults, results, rootPath, getSourcemap, filterRerunTestPaths })=>{
|
|
3096
|
-
const failedTests = [
|
|
3097
|
-
...results.filter((i)=>'fail' === i.status && i.errors?.length && (filterRerunTestPaths ? filterRerunTestPaths.includes(i.testPath) : true)),
|
|
3098
|
-
...testResults.filter((i)=>'fail' === i.status && (filterRerunTestPaths ? filterRerunTestPaths.includes(i.testPath) : true))
|
|
3099
|
-
];
|
|
3100
|
-
if (0 === failedTests.length) return;
|
|
3101
|
-
utils.vF.log('');
|
|
3102
|
-
utils.vF.log(utils.yW.bold('Summary of all failing tests:'));
|
|
3103
|
-
utils.vF.log('');
|
|
3104
|
-
for (const test of failedTests){
|
|
3105
|
-
const relativePath = dist.Ay.relative(rootPath, test.testPath);
|
|
3106
|
-
const nameStr = (0, utils.fN)(test);
|
|
3107
|
-
utils.vF.log(`${utils.yW.bgRed(' FAIL ')} ${(0, utils.EQ)(relativePath)} ${nameStr.length ? `${utils.yW.dim(utils.vO)} ${nameStr}` : ''}`);
|
|
3108
|
-
if (test.errors) {
|
|
3109
|
-
const { printError } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
|
|
3110
|
-
for (const error of test.errors)await printError(error, getSourcemap, rootPath);
|
|
3111
|
-
}
|
|
3112
|
-
}
|
|
3113
|
-
};
|
|
3114
3135
|
const statusStr = {
|
|
3115
3136
|
fail: '✗',
|
|
3116
3137
|
pass: '✓',
|
|
@@ -3132,12 +3153,11 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
3132
3153
|
utils.vF.log(` ${icon} ${nameStr}${utils.yW.gray(duration)}${retry}`);
|
|
3133
3154
|
if (result.errors) for (const error of result.errors)console.error(utils.yW.red(` ${error.message}`));
|
|
3134
3155
|
};
|
|
3135
|
-
const logFileTitle = (test, relativePath,
|
|
3156
|
+
const logFileTitle = (test, relativePath, alwaysShowTime = false)=>{
|
|
3136
3157
|
let title = ` ${utils.yW.bold(statusColorfulStr[test.status])} ${(0, utils.EQ)(relativePath)}`;
|
|
3137
|
-
const formatDuration = (duration)=>utils.yW
|
|
3158
|
+
const formatDuration = (duration)=>utils.yW.green((0, utils.kV)(duration));
|
|
3138
3159
|
title += ` ${utils.yW.gray(`(${test.results.length})`)}`;
|
|
3139
|
-
|
|
3140
|
-
if (alwaysShowTime || isTooSlow) title += ` ${formatDuration(test.duration)}`;
|
|
3160
|
+
if (alwaysShowTime) title += ` ${formatDuration(test.duration)}`;
|
|
3141
3161
|
utils.vF.log(title);
|
|
3142
3162
|
};
|
|
3143
3163
|
class DefaultReporter {
|
|
@@ -3152,24 +3172,21 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
3152
3172
|
if (!T) this.statusRenderer = new StatusRenderer(rootPath);
|
|
3153
3173
|
}
|
|
3154
3174
|
onTestFileStart(test) {
|
|
3155
|
-
this.statusRenderer?.
|
|
3175
|
+
this.statusRenderer?.onTestFileStart(test.testPath);
|
|
3156
3176
|
}
|
|
3157
3177
|
onTestFileResult(test) {
|
|
3158
|
-
this.statusRenderer?.
|
|
3178
|
+
this.statusRenderer?.onTestFileResult(test);
|
|
3159
3179
|
const relativePath = (0, pathe_M_eThtNZ.b)(this.rootPath, test.testPath);
|
|
3160
3180
|
const { slowTestThreshold } = this.config;
|
|
3161
|
-
logFileTitle(test, relativePath
|
|
3162
|
-
const isTooSlow = test.duration && test.duration > slowTestThreshold;
|
|
3163
|
-
const hasRetryCase = test.results.some((result)=>(result.retryCount || 0) > 0);
|
|
3164
|
-
if ('fail' !== test.status && !isTooSlow && !hasRetryCase) return;
|
|
3165
|
-
const showAllCases = isTooSlow && !test.results.some((result)=>(result.duration || 0) > slowTestThreshold);
|
|
3181
|
+
logFileTitle(test, relativePath);
|
|
3166
3182
|
for (const result of test.results){
|
|
3167
|
-
const
|
|
3168
|
-
|
|
3169
|
-
if (showAllCases || 'fail' === result.status || isSlowCase || retried) logCase(result, slowTestThreshold);
|
|
3183
|
+
const isDisplayed = 'fail' === result.status || (result.duration ?? 0) > slowTestThreshold || (result.retryCount ?? 0) > 0;
|
|
3184
|
+
isDisplayed && logCase(result, slowTestThreshold);
|
|
3170
3185
|
}
|
|
3171
3186
|
}
|
|
3172
|
-
onTestCaseResult(
|
|
3187
|
+
onTestCaseResult(result) {
|
|
3188
|
+
this.statusRenderer?.onTestCaseResult(result);
|
|
3189
|
+
}
|
|
3173
3190
|
onUserConsoleLog(log) {
|
|
3174
3191
|
const shouldLog = this.config.onConsoleLog?.(log.content) ?? true;
|
|
3175
3192
|
if (!shouldLog) return;
|
|
@@ -3397,10 +3414,10 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
3397
3414
|
}
|
|
3398
3415
|
class VerboseReporter extends DefaultReporter {
|
|
3399
3416
|
onTestFileResult(test) {
|
|
3400
|
-
this.statusRenderer?.
|
|
3417
|
+
this.statusRenderer?.onTestFileResult(test);
|
|
3401
3418
|
const relativePath = (0, pathe_M_eThtNZ.b)(this.rootPath, test.testPath);
|
|
3402
3419
|
const { slowTestThreshold } = this.config;
|
|
3403
|
-
logFileTitle(test, relativePath,
|
|
3420
|
+
logFileTitle(test, relativePath, true);
|
|
3404
3421
|
for (const result of test.results)logCase(result, slowTestThreshold);
|
|
3405
3422
|
}
|
|
3406
3423
|
}
|
|
@@ -3443,7 +3460,7 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
3443
3460
|
});
|
|
3444
3461
|
this.reporters = reporters;
|
|
3445
3462
|
this.snapshotManager = snapshotManager;
|
|
3446
|
-
this.version = "0.5.
|
|
3463
|
+
this.version = "0.5.3";
|
|
3447
3464
|
this.rootPath = rootPath;
|
|
3448
3465
|
this.originalConfig = userConfig;
|
|
3449
3466
|
this.normalizedConfig = rstestConfig;
|
package/dist/worker.js
CHANGED
|
@@ -8407,6 +8407,9 @@ const runInPool = async (options)=>{
|
|
|
8407
8407
|
const { assetFiles, sourceMaps: sourceMapsFromAssets } = assets || await rpc.getAssetsByEntry();
|
|
8408
8408
|
sourceMaps = sourceMapsFromAssets;
|
|
8409
8409
|
cleanups.push(cleanup);
|
|
8410
|
+
rpc.onTestFileStart?.({
|
|
8411
|
+
testPath
|
|
8412
|
+
});
|
|
8410
8413
|
await loadFiles({
|
|
8411
8414
|
rstestContext,
|
|
8412
8415
|
distPath,
|
|
@@ -8417,9 +8420,6 @@ const runInPool = async (options)=>{
|
|
|
8417
8420
|
isolate
|
|
8418
8421
|
});
|
|
8419
8422
|
const results = await runner.runTests(testPath, {
|
|
8420
|
-
onTestFileStart: async (test)=>{
|
|
8421
|
-
await rpc.onTestFileStart(test);
|
|
8422
|
-
},
|
|
8423
8423
|
onTestCaseResult: async (result)=>{
|
|
8424
8424
|
await rpc.onTestCaseResult(result);
|
|
8425
8425
|
}
|
package/dist-types/index.d.ts
CHANGED
|
@@ -589,7 +589,7 @@ declare class DefaultReporter implements Reporter {
|
|
|
589
589
|
});
|
|
590
590
|
onTestFileStart(test: TestFileInfo): void;
|
|
591
591
|
onTestFileResult(test: TestFileResult): void;
|
|
592
|
-
onTestCaseResult(
|
|
592
|
+
onTestCaseResult(result: TestResult): void;
|
|
593
593
|
onUserConsoleLog(log: UserConsoleLog): void;
|
|
594
594
|
onExit(): Promise<void>;
|
|
595
595
|
onTestRunEnd({ results, testResults, duration, getSourcemap, snapshotSummary, filterRerunTestPaths, }: {
|
|
@@ -2670,10 +2670,13 @@ declare class StatusRenderer {
|
|
|
2670
2670
|
private rootPath;
|
|
2671
2671
|
private renderer;
|
|
2672
2672
|
private runningModules;
|
|
2673
|
+
private testModules;
|
|
2674
|
+
private startTime;
|
|
2673
2675
|
constructor(rootPath: string);
|
|
2674
2676
|
getContent(): string[];
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
+
onTestFileStart(testPath: string): void;
|
|
2678
|
+
onTestCaseResult(result: TestResult): void;
|
|
2679
|
+
onTestFileResult(test: TestFileResult): void;
|
|
2677
2680
|
clear(): void;
|
|
2678
2681
|
}
|
|
2679
2682
|
|
package/dist-types/worker.d.ts
CHANGED
|
@@ -498,7 +498,7 @@ declare class DefaultReporter implements Reporter {
|
|
|
498
498
|
});
|
|
499
499
|
onTestFileStart(test: TestFileInfo): void;
|
|
500
500
|
onTestFileResult(test: TestFileResult): void;
|
|
501
|
-
onTestCaseResult(
|
|
501
|
+
onTestCaseResult(result: TestResult): void;
|
|
502
502
|
onUserConsoleLog(log: UserConsoleLog): void;
|
|
503
503
|
onExit(): Promise<void>;
|
|
504
504
|
onTestRunEnd({ results, testResults, duration, getSourcemap, snapshotSummary, filterRerunTestPaths, }: {
|
|
@@ -2219,10 +2219,13 @@ declare class StatusRenderer {
|
|
|
2219
2219
|
private rootPath;
|
|
2220
2220
|
private renderer;
|
|
2221
2221
|
private runningModules;
|
|
2222
|
+
private testModules;
|
|
2223
|
+
private startTime;
|
|
2222
2224
|
constructor(rootPath: string);
|
|
2223
2225
|
getContent(): string[];
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
+
onTestFileStart(testPath: string): void;
|
|
2227
|
+
onTestCaseResult(result: TestResult): void;
|
|
2228
|
+
onTestFileResult(test: TestFileResult): void;
|
|
2226
2229
|
clear(): void;
|
|
2227
2230
|
}
|
|
2228
2231
|
|