Skip to content

Commit

Permalink
BREAKING CHANGE: removing report cli
Browse files Browse the repository at this point in the history
  • Loading branch information
L0wry committed Aug 1, 2018
1 parent 3adbb63 commit 79d2e1d
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions src/bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,43 +98,25 @@ program

if (options.browser) config.browser = options.browser;
config.remote = options.remote;
validateConfig(config, options.remote);
validateConfig(config, config.remote);

createDirectories(fs, config);
clearDirectory(fs, config);
await createBucket(config);
await fetchRemoteComparisonImages(config);
await createComparisons(fs, config);

Reporter.state.failed.count > 0
? (process.exitCode = 1)
: (process.exitCode = 0);
} catch (err) {
handleError(err);
}
});

program
.command('generate-report')
.option('c, --config [config]', 'Path to your config')
.option('r, --remote', 'Upload new baseline to remote storage')
.option(
'-b, --browser [browser]',
'Select the browser to run your tests on. E.G. chrome, firefox, etc.'
)
.action(options => {
try {
const config = require(path.resolve(options.config)); // eslint-disable-line import/no-dynamic-require

if (options.browser) config.browser = options.browser;

validateConfig(config, options.remote);
if (Reporter.state.failed.count > 0) {
const generateReport = config.remote
? generateRemoteReport
: generateLocalReport;

const generateReport = options.remote
? generateRemoteReport
: generateLocalReport;
generateReport(config);

generateReport(config);
process.exitCode = 1;
} else {
process.exitCode = 0;
}
} catch (err) {
handleError(err);
}
Expand Down

0 comments on commit 79d2e1d

Please sign in to comment.