File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ describe('jiraIssue()', () => {
29
29
'Please add the JIRA issue key to the PR title (e.g. ABC-123)'
30
30
)
31
31
} )
32
+ it ( 'only adds one example key to warning' , ( ) => {
33
+ global . danger = { github : { pr : { title : 'Change some things' } } }
34
+ jiraIssue ( {
35
+ key : [ 'ABC' , 'DEF' ] ,
36
+ url : 'https://jira.net/browse' ,
37
+ } )
38
+ expect ( global . warn ) . toHaveBeenCalledWith (
39
+ 'Please add the JIRA issue key to the PR title (e.g. ABC-123)'
40
+ )
41
+ } )
32
42
it ( 'adds the JIRA issue link to the messages table' , ( ) => {
33
43
global . danger = {
34
44
github : { pr : { title : '[ABC-808] Change some things' } } ,
Original file line number Diff line number Diff line change @@ -95,8 +95,9 @@ export default function jiraIssue(options: Options) {
95
95
message ( `${ emoji } ${ jiraUrls . join ( ', ' ) } ` )
96
96
}
97
97
} else {
98
+ const firstKey = Array . isArray ( key ) ? key [ 0 ] : key
98
99
warn (
99
- `Please add the JIRA issue key to the PR ${ location } (e.g. ${ key } -123)`
100
+ `Please add the JIRA issue key to the PR ${ location } (e.g. ${ firstKey } -123)`
100
101
)
101
102
}
102
103
}
You can’t perform that action at this time.
0 commit comments