Skip to content

Commit

Permalink
component errors -> test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
codykaup committed Oct 17, 2024
1 parent 41b4056 commit 2c10a93
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions node-src/ui/tasks/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const stats = ({
return {
tests: pluralize('test', build.actualTestCount, true),
errors: pluralize('component error', build.errorCount, true),
e2eErrors: pluralize('test error', build.errorCount, true),
changes: pluralize('change', build.changeCount, true),
stories: pluralize('story', build.specCount, true),
e2eTests: pluralize('test', build.specCount, true),
Expand All @@ -55,15 +56,20 @@ export const pending = (ctx: Context, { cursor = 0, label = '' } = {}) => {
};
}

const { errors, tests, skips } = stats(ctx);
const { errors, e2eErrors, tests, skips } = stats(ctx);
const matching = options.onlyStoryNames
? ` for stories matching ${options.onlyStoryNames.map((v) => `'${v}'`).join(', ')}`
: '';
const affected = onlyStoryFiles ? ' affected by recent changes' : '';
const skipping = build.testCount > build.actualTestCount ? ` (skipping ${skips})` : '';
const percentage = Math.round((cursor / build.actualTestCount) * 100);
const counts = `${cursor}/${build.actualTestCount}`;
const errs = build.errorCount ? `(${errors}) ` : '';

let errs = '';
if (build.errorCount) {
errs = isE2EBuild(ctx.options) ? `(${e2eErrors}) ` : `(${errors}) `;
}

return {
status: 'pending',
title: `Running ${tests}${matching}${affected}${skipping}`,
Expand Down Expand Up @@ -102,9 +108,9 @@ export const buildComplete = (ctx: Context) => {
};

export const buildBroken = (ctx: Context) => {
const { snapshots, components, stories, e2eTests, errors } = stats(ctx);
const { snapshots, components, stories, e2eTests, errors, e2eErrors } = stats(ctx);
const output = isE2EBuild(ctx.options)
? `Tested ${e2eTests}; captured ${snapshots} and found ${errors}`
? `Tested ${e2eTests}; captured ${snapshots} and found ${e2eErrors}`
: `Tested ${stories} across ${components}; captured ${snapshots} and found ${errors}`;

return {
Expand Down

0 comments on commit 2c10a93

Please sign in to comment.