Skip to content

Fix: reporting improvements #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function start() {
let table = new Table({
head: ['Spec', 'Time', 'Tests', 'Passing', 'Failing', 'Pending'],
style: { head: ['blue'] },
colWidths: [50, 8, 7, 9, 9, 9]
colWidths: [100, 10, 10, 10, 10, 10]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!A fixed width could not work for everyone, and people using small screens would end up seeing a messed up table. I think I found a better solution by making the width flexible based on the spec name length:

colWidths: [getMaxPathLenghtFrom(testSuitePaths), 10, 10, 10, 10, 10]

});

let totalTests = 0;
Expand Down Expand Up @@ -112,11 +112,6 @@ async function start() {
process.exit(1);
}

if (totalFailures > 0) {
process.stderr.write(`\x1b[31m${totalFailures} test failure(s)\n`);
process.exit(1);
}

const timeSaved = totalDuration - timeTaken;
console.log(
`Total run time: ${totalDuration / 1000}s, executed in: ${
Expand All @@ -126,6 +121,11 @@ async function start() {
)}%)`
);

if (totalFailures > 0) {
process.stderr.write(`\x1b[31m${totalFailures} test failure(s)\n`);
process.exit(1);
}

generateWeightsFile(specWeights, totalDuration, totalWeight);
process.exit(totalFailures);
}
Expand Down