File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed
Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ describe("renderDangerReport", () => {
5454
5555 const output = renderDangerReport ( result ) ;
5656
57- expect ( output ) . toMatch ( / \| \s * S o u r c e \s * \| \s * \* \* 4 \* \* \s * \| \s * 3 \s * \| \s * 1 \s * \| \s * \* \* 1 \* \* \s * \| \s * - \s * \| \s * 1 \s * \| \s * - \s * \| \s * - \s * \| / ) ;
58- expect ( output ) . toMatch ( / \| \s * T e s t s \s * \| \s * \* \* 2 \* \* \s * \| \s * 2 \s * \| \s * - \s * \| \s * \* \* 1 \* \* \s * \| \s * - \s * \| \s * 1 \s * \| \s * - \s * \| \s * - \s * \| / ) ;
57+ expect ( output ) . toMatch ( / \| \s * 🛠 ️ S o u r c e \s * \| \s * \* \* 4 \* \* \s * \| \s * 3 \s * \| \s * 1 \s * \| \s * \* \* 1 \* \* \s * \| \s * - \s * \| \s * 1 \s * \| \s * - \s * \| \s * - \s * \| / u ) ;
58+ expect ( output ) . toMatch ( / \| \s * 🧪 U n i t T e s t s \s * \| \s * \* \* 2 \* \* \s * \| \s * 2 \s * \| \s * - \s * \| \s * \* \* 1 \* \* \s * \| \s * - \s * \| \s * 1 \s * \| \s * - \s * \| \s * - \s * \| / u ) ;
5959 expect ( output ) . toMatch ( / \| \s * \* \* T o t a l \* \* \s * \| \s * \* \* 6 \* \* \s * \| \s * 5 \s * \| \s * 1 \s * \| \s * \* \* 2 \* \* \s * \| / ) ;
6060 expect ( output ) . toContain ( "## ✨ Highlights" ) ;
6161 expect ( output . trim ( ) . startsWith ( "> 🚧 Danger.js checks for MrDocs" ) ) . toBe ( true ) ;
@@ -68,7 +68,7 @@ describe("renderDangerReport", () => {
6868 const result : DangerResult = { warnings : [ ] , infos : [ ] , summary } ;
6969
7070 const output = renderDangerReport ( result ) ;
71- const sourceRow = output . split ( "\n" ) . find ( ( line ) => line . startsWith ( "| Source" ) ) ;
71+ const sourceRow = output . split ( "\n" ) . find ( ( line ) => line . startsWith ( "| 🛠️ Source" ) ) ;
7272
7373 expect ( sourceRow ) . toBeDefined ( ) ;
7474 expect ( sourceRow ) . not . toMatch ( / - 1 / ) ;
Original file line number Diff line number Diff line change @@ -13,20 +13,37 @@ const notice = "> 🚧 Danger.js checks for MrDocs are experimental; expect some
1313
1414const scopeLabels : Record < string , string > = {
1515 source : "Source" ,
16- tests : "Tests" ,
16+ tests : "Unit Tests" ,
1717 "golden-tests" : "Golden Tests" ,
1818 docs : "Docs" ,
19- ci : "CI / Roadmap " ,
19+ ci : "CI" ,
2020 build : "Build / Toolchain" ,
2121 tooling : "Tooling" ,
2222 "third-party" : "Third-party" ,
2323 other : "Other" ,
2424} ;
2525
26+ const scopeEmojis : Record < string , string > = {
27+ source : "🛠️" ,
28+ tests : "🧪" ,
29+ "golden-tests" : "🥇" ,
30+ docs : "📄" ,
31+ ci : "⚙️" ,
32+ build : "🏗️" ,
33+ tooling : "🧰" ,
34+ "third-party" : "🤝" ,
35+ other : "📦" ,
36+ } ;
37+
2638function labelForScope ( scope : string ) : string {
2739 return scopeLabels [ scope ] ?? scope ;
2840}
2941
42+ function emojiLabelForScope ( scope : string ) : string {
43+ const emoji = scopeEmojis [ scope ] ?? "❓" ;
44+ return `${ emoji } ${ labelForScope ( scope ) } ` ;
45+ }
46+
3047/**
3148 * Pad cells so pipes align in the raw Markdown.
3249 */
@@ -122,7 +139,7 @@ function renderChangeTable(summary: ScopeReport): string {
122139 const fileDelta = countFileChanges ( s ) ;
123140 const churn = scoped . additions + scoped . deletions ;
124141 const fileDeltaBold = formatCount ( fileDelta ) ; // bold delta
125- const label = labelForScope ( scope ) ;
142+ const label = emojiLabelForScope ( scope ) ;
126143 return [
127144 label ,
128145 formatCount ( churn ) ,
You can’t perform that action at this time.
0 commit comments