Skip to content

Commit

Permalink
Add option to disable progress output (Issue smashtestio#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
gchin committed Jun 9, 2021
1 parent c90f52f commit fa1083b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const hRule = chalk.gray("─".repeat(process.stdout.columns));

const CONFIG_FILENAME = 'smashtest.json';

const PROGRESS_BAR_ON = true;
// const PROGRESS_BAR_ON = true;

This comment has been minimized.

Copy link
@mendhak

mendhak Jun 9, 2021

Remove commented out code

let fullRun = false;

console.log(hRule);
Expand Down Expand Up @@ -162,6 +162,7 @@ Options
--no-debug Fail if there are any $'s or ~'s. Useful to prevent debugging in CI.
--output-errors=<true/false> Whether to output all errors to console
--p:<name>="<value>" Set a persistent variable
--progress-bar=<true/false> Whether to output a progress bar
--random=<true/false> Whether to randomize the order of branches
--recursive Scan the current directory and subdirectories for .smash files
--repl Open the REPL (drive Smashtest from command line) (-r)
Expand Down Expand Up @@ -213,6 +214,10 @@ Options
runner.persistent[varName] = value;
break;

case "progress-bar":
runner.showProgressBar = boolValue();
break;

case "random":
runner.random = boolValue();
break;
Expand Down Expand Up @@ -488,6 +493,7 @@ function plural(count) {
// Output errors to console by default, do not output all steps to console by default
runner.outputErrors = true;
runner.consoleOutput = false;
runner.showProgressBar = true;

// No reporter for debug or repl runs
if(tree.isDebug || runner.isRepl) {
Expand Down Expand Up @@ -792,7 +798,7 @@ function plural(count) {
let progressBar = null;
fullRun = true;

if(PROGRESS_BAR_ON) {
if(runner.showProgressBar) {
// Progress bar
progressBar = generateProgressBar(true);
progressBar.start(tree.counts.totalSteps, tree.counts.totalStepsComplete);
Expand Down

0 comments on commit fa1083b

Please sign in to comment.