Skip to content

Commit

Permalink
Merge pull request #3 from danger/master
Browse files Browse the repository at this point in the history
Pull from master
  • Loading branch information
HelloCore authored Jun 26, 2019
2 parents 6cd099c + 835af1c commit 7cf422f
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@

<!-- Your comment below this -->

# 9.0.1

- Fixed incorrect main comment template on Bitbucket Cloud - [@HelloCore]

# 9.0.0

- Add BitBucket Cloud & BitBucket Pipelines support [@HelloCore]
- Add BitBucket Cloud & BitBucket Pipelines support - [@HelloCore]
- Add GitLab missing states - [@f-meloni]
- Fixes incorrect slug for builds from forks on Codefresh - [@stevenp]

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "danger",
"version": "9.0.0",
"version": "9.0.1",
"description": "Unit tests for Team Culture",
"main": "distribution/danger.js",
"typings": "distribution/danger.d.ts",
Expand Down
7 changes: 7 additions & 0 deletions source/runner/_tests/fixtures/ExampleDangerResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,10 @@ export const resultsWithCustomMeta: DangerResults = {
runtimeHref: "https://danger.magic",
},
}

export const multipleSummaryResults: DangerResults = {
fails: [{ message: "Failing message Failing message" }, { message: "Failing message 2, This is Failing message" }],
warnings: [{ message: "Warning message Warning message" }, { message: "Warning message" }],
messages: [{ message: "message" }, { message: "message 2" }, { message: "message 3" }],
markdowns: [{ message: "markdown" }],
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,47 @@ markdown
"
`;

exports[`generating messages for BitBucket cloud multiple summary result matches snapshot 1`] = `
"
⚠️ Danger found some issues. Don't worry, everything is fixable.
| 2 Fails |
| --- |
| ❌ - Failing message Failing message |
| ❌ - Failing message 2, This is Failing message |
| 2 Warnings |
| --- |
| ⚠️ - Warning message Warning message |
| ⚠️ - Warning message |
| 3 Messages |
| --- |
| ✨ - message |
| ✨ - message 2 |
| ✨ - message 3 |
markdown
Generated by 🚫 [dangerJS](https://danger.systems/js) against e70f3d6468f61a4bef68c9e6eaba9166b096e23c
[](http://danger-id-blankID;)
"
`;

exports[`generating messages for BitBucket cloud summary result matches snapshot 1`] = `
"
⚠️ Danger found some issues. Don't worry, everything is fixable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
messagesResults,
markdownResults,
summaryResults,
multipleSummaryResults,
} from "../../_tests/fixtures/ExampleDangerResults"
import { dangerSignaturePostfix, template, inlineTemplate } from "../bitbucketCloudTemplate"
import { DangerResults } from "../../../dsl/DangerResults"
Expand Down Expand Up @@ -47,6 +48,10 @@ describe("generating messages for BitBucket cloud", () => {
expect(template("blankID", commitID, summaryResults)).toMatchSnapshot()
})

it("multiple summary result matches snapshot", () => {
expect(template("blankID", commitID, multipleSummaryResults)).toMatchSnapshot()
})

it("shows a postfix message indicating the current commit ID at the time of comment", () => {
expect(template("blankID", commitID, emptyResults)).toContain(dangerSignaturePostfix({} as DangerResults, commitID))
})
Expand Down
2 changes: 1 addition & 1 deletion source/runner/templates/bitbucketCloudTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function buildMarkdownTable(header: string, emoji: string, violations: Violation
| ${violations.length} ${header} |
| --- |
${violations.map(v => `| ${emoji} - ${v.message} |`)}
${violations.map(v => ` | ${emoji} - ${v.message} |`).join("\n")}
`
}
Expand Down

0 comments on commit 7cf422f

Please sign in to comment.