Skip to content
This repository has been archived by the owner on Mar 3, 2019. It is now read-only.

Commit

Permalink
exit with code 1, when flow is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Schmidt committed Jun 18, 2018
1 parent 5a72d56 commit 9c4a38c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ exports.run = () => {
}

generateFlowCoverageReport({...args}).then(([coverageSummaryData]) => {
const {percent, threshold} = coverageSummaryData;
const {percent, threshold, flowStatus} = coverageSummaryData;

if (!flowStatus.passed) {
process.exit(1); // eslint-disable-line unicorn/no-process-exit
}

if (percent < threshold) {
console.error(
`Flow Coverage ${percent}% is below the required threshold ${threshold}%`
Expand Down

0 comments on commit 9c4a38c

Please sign in to comment.