Skip to content

Commit

Permalink
update: return non-0 exit code for compare w/changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maniator committed Aug 11, 2022
1 parent fe7a148 commit 8149cd1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/reg-suit-cli/src/commands/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import getRegCore from "../get-reg-core";
async function compare(options: CliOptions) {
const processor = getRegCore(options).createProcessor();
const ctx = await processor.getExpectedKey();
await processor.compare(ctx);
const { comparisonResult } = await processor.compare(ctx);
const numberOfFailed = comparisonResult.failedItems.length;

if (numberOfFailed) {
throw new Error(`There were ${numberOfFailed} failed snapshots`);
}

return null;
}

Expand Down

0 comments on commit 8149cd1

Please sign in to comment.