Skip to content

Commit

Permalink
Merge pull request #1092 from JanStevens/patch-1
Browse files Browse the repository at this point in the history
Use markdown styled icons instead of unicode chars
  • Loading branch information
orta committed Jan 4, 2021
2 parents 3a90dec + 79764c5 commit fccf835
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 53 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<!-- Your comment below this -->

- Bitbucket Cloud: Add markdown emoji instead of unicode [@JanStevens]
- Add `DANGER_DISABLE_TSC` environment variable to disable transpiling with tsc, providing a way to force transpiling
with Babel - [@ozzieorca]
- Adds options `--newComment` and `--removePreviousComments` - [@davidhouweling]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ exports[`generating inline messages summary inline result matches snapshot 1`] =
"
[//]: # (danger-id-blankID;)
[//]: # ( File: File.swift;Line: 5;)
- Failing message Failing message
- ⚠️ Warning message Warning message
- message
- :x: Failing message Failing message
- :warning: Warning message Warning message
- :sparkles: message
markdown
"
`;

exports[`generating messages for BitBucket cloud Mixed icon messages match snapshot 1`] = `
"
🎉 All green. Well done.
:tada: All green. Well done.
Expand All @@ -23,151 +23,151 @@ exports[`generating messages for BitBucket cloud Mixed icon messages match snaps
| --- |
| 📝 - Message with custom icon |
| 🔔 - Message with custom icon2 |
| - Test message |
| :sparkles: - Test message |
Generated by 🚫 [dangerJS](https://danger.systems/js) against e70f3d6468f61a4bef68c9e6eaba9166b096e23c
Generated by :no_entry_sign: [dangerJS](https://danger.systems/js) against e70f3d6468f61a4bef68c9e6eaba9166b096e23c
[](http://danger-id-blankID;)
"
`;

exports[`generating messages for BitBucket cloud empty result matches snapshot, with a compliment 1`] = `
"
🎉 All green. Well done.
:tada: All green. Well done.
Generated by 🚫 [dangerJS](https://danger.systems/js) against e70f3d6468f61a4bef68c9e6eaba9166b096e23c
Generated by :no_entry_sign: [dangerJS](https://danger.systems/js) against e70f3d6468f61a4bef68c9e6eaba9166b096e23c
[](http://danger-id-blankID;)
"
`;

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

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

exports[`generating messages for BitBucket cloud summary result matches snapshot, without a commit 1`] = `
"
⚠️ Danger found some issues. Don't worry, everything is fixable.
:warning: Danger found some issues. Don't worry, everything is fixable.
| 1 Fails |
| --- |
| - Failing message Failing message |
| :x: - Failing message Failing message |
| 1 Warnings |
| --- |
| ⚠️ - Warning message Warning message |
| :warning: - Warning message Warning message |
| 1 Messages |
| --- |
| - message |
| :sparkles: - message |
markdown
Generated by 🚫 [dangerJS](https://danger.systems/js)
Generated by :no_entry_sign: [dangerJS](https://danger.systems/js)
[](http://danger-id-blankID;)
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import * as utils from "../../DangerUtils"

const commitID = "e70f3d6468f61a4bef68c9e6eaba9166b096e23c"

const noEntryEmoji = ""
const warningEmoji = "⚠️"
const messageEmoji = ""
const noEntryEmoji = ":x:"
const warningEmoji = ":warning:"
const messageEmoji = ":sparkles:"

describe("generating messages for BitBucket cloud", () => {
let complimentMock: jest.Mock<string, []>
Expand Down
16 changes: 8 additions & 8 deletions source/runner/templates/bitbucketCloudTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Violation } from "../../dsl/Violation"
import { compliment } from "../DangerUtils"

// BitBucket Cloud supports these emojis 🎉
const noEntryEmoji = ""
const warningEmoji = "⚠️"
const messageEmoji = ""
const signatureEmoji = "🚫"
const successEmoji = "🎉"
const noEntryEmoji = ":x:"
const warningEmoji = ":warning:"
const messageEmoji = ":sparkles:"
const signatureEmoji = ":no_entry_sign:"
const successEmoji = ":tada:"

export const dangerSignature = (results: DangerResults) => {
let meta = results.meta || { runtimeName: "dangerJS", runtimeHref: "https://danger.systems/js" }
Expand Down Expand Up @@ -65,11 +65,11 @@ export function template(dangerID: string, results: DangerResults, commitID?: st
${buildMarkdownTable("Fails", noEntryEmoji, results.fails)}
${buildMarkdownTable("Warnings", warningEmoji, results.warnings)}
${buildMarkdownTable("Messages", messageEmoji, results.messages)}
${results.markdowns.map(v => v.message).join("\n\n")}
${dangerSignaturePostfix(results, commitID)}
[](http://${dangerIDToString(dangerID)})
`
}
Expand Down

0 comments on commit fccf835

Please sign in to comment.