diff --git a/source/dsl/DangerResults.ts b/source/dsl/DangerResults.ts index bd838bdc0..2e1036d3d 100644 --- a/source/dsl/DangerResults.ts +++ b/source/dsl/DangerResults.ts @@ -208,7 +208,7 @@ export function sortResults(results: DangerResults): DangerResults { } } -export function isEmpty(results: DangerResults): boolean { +export function isEmptyResults(results: DangerResults): boolean { return [...results.fails, ...results.warnings, ...results.messages, ...results.markdowns].length === 0 } diff --git a/source/dsl/_tests/DangerResults.test.ts b/source/dsl/_tests/DangerResults.test.ts index b2fb10e42..bb9fdec17 100644 --- a/source/dsl/_tests/DangerResults.test.ts +++ b/source/dsl/_tests/DangerResults.test.ts @@ -7,7 +7,7 @@ import { regularResults, sortInlineResults, validateResults, - isEmpty, + isEmptyResults, } from "../DangerResults" import { singleViolationSingleFileResults, @@ -92,13 +92,13 @@ describe("DangerResults operations", () => { }) it("find empty results", () => { - const result = isEmpty(emptyDangerResults) + const result = isEmptyResults(emptyDangerResults) expect(result).toEqual(true) }) it("find empty results", () => { - const result = isEmpty(multipleViolationSingleFileResults) + const result = isEmptyResults(multipleViolationSingleFileResults) expect(result).toEqual(false) }) diff --git a/source/runner/Executor.ts b/source/runner/Executor.ts index c71564a16..dc5c5ee5b 100644 --- a/source/runner/Executor.ts +++ b/source/runner/Executor.ts @@ -13,7 +13,7 @@ import { sortResults, sortInlineResults, validateResults, - isEmpty, + isEmptyResults, } from "../dsl/DangerResults" import { template as githubResultsTemplate, @@ -236,7 +236,7 @@ export class Executor { const mergedResults = sortResults(mergeResults(regular, inlineLeftovers)) // If danger have no comments other than inline to update. Just delete previous main comment. - if (isEmpty(mergedResults)) { + if (isEmptyResults(mergedResults)) { this.platform.deleteMainComment(dangerID) } else { const comment = process.env["DANGER_BITBUCKETSERVER_HOST"]