From 79d2e1d870c29a1965afeb31118da0f5de03c4a9 Mon Sep 17 00:00:00 2001 From: L0wry Date: Wed, 1 Aug 2018 17:50:11 +0100 Subject: [PATCH] BREAKING CHANGE: removing report cli --- src/bin/run.js | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/src/bin/run.js b/src/bin/run.js index 79a48bc..30c787a 100644 --- a/src/bin/run.js +++ b/src/bin/run.js @@ -98,7 +98,7 @@ 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); @@ -106,35 +106,17 @@ program 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); }