@@ -4,7 +4,7 @@ import m from '..';
44test ( 'Parse GitHub issue' , t => {
55 t . deepEqual (
66 m ( 'GitHub' ) (
7- 'Fix #1 reSOLved gh-2 CLOSES Gh-3 fix o/r#4 #5 o/r#6 fix https://github.com/o/r/issues/7 https://github.com/o/r/issues/8 fix https://github.com/o/r/pull/9 https://github.com/o/r/pull/10 fixing #11 Duplicate OF #12 @user'
7+ 'Fix #1 reSOLved gh-2 CLOSES Gh-3 fix o/r#4 #5 o/r#6 fix https://github.com/o/r/issues/7 https://github.com/o/r/issues/8 fix https://github.com/o/r/pull/9 https://github.com/o/r/pull/10 fixing #11 Duplicate OF #12 Fix:#13 Fix: #14 Fix::#15 @user'
88 ) ,
99 {
1010 actions : {
@@ -15,6 +15,8 @@ test('Parse GitHub issue', t => {
1515 { raw : 'fix o/r#4' , action : 'Fix' , slug : 'o/r' , prefix : '#' , issue : '4' } ,
1616 { raw : 'fix https://github.com/o/r/issues/7' , action : 'Fix' , slug : 'o/r' , prefix : undefined , issue : '7' } ,
1717 { raw : 'fix https://github.com/o/r/pull/9' , action : 'Fix' , slug : 'o/r' , prefix : undefined , issue : '9' } ,
18+ { raw : 'Fix:#13' , action : 'Fix' , slug : undefined , prefix : '#' , issue : '13' } ,
19+ { raw : 'Fix: #14' , action : 'Fix' , slug : undefined , prefix : '#' , issue : '14' } ,
1820 ] ,
1921 duplicate : [ { raw : 'Duplicate OF #12' , action : 'Duplicate of' , slug : undefined , prefix : '#' , issue : '12' } ] ,
2022 } ,
@@ -24,6 +26,7 @@ test('Parse GitHub issue', t => {
2426 { raw : 'https://github.com/o/r/issues/8' , slug : 'o/r' , prefix : undefined , issue : '8' } ,
2527 { raw : 'https://github.com/o/r/pull/10' , slug : 'o/r' , prefix : undefined , issue : '10' } ,
2628 { raw : '#11' , slug : undefined , prefix : '#' , issue : '11' } ,
29+ { raw : '#15' , slug : undefined , prefix : '#' , issue : '15' } ,
2730 ] ,
2831 mentions : [ { raw : '@user' , prefix : '@' , user : 'user' } ] ,
2932 }
@@ -130,7 +133,7 @@ test('Parse Waffle issue', t => {
130133test ( 'Parse with default options' , t => {
131134 t . deepEqual (
132135 m ( ) (
133- 'Fix #1 reSOLved gh-2 CLOSES Gh-3 fix o/r#4 #5 o/r#6 implementing #7 https://github.com/o/r/issues/8 implementing https://github.com/o/r/issues/9 Duplicate OF #10 @user'
136+ 'Fix #1 reSOLved gh-2 CLOSES Gh-3 fix o/r#4 #5 o/r#6 implementing #7 https://github.com/o/r/issues/8 implementing https://github.com/o/r/issues/9 Duplicate OF #10 Fix: #11 @user'
134137 ) ,
135138 {
136139 actions : {
@@ -147,6 +150,7 @@ test('Parse with default options', t => {
147150 prefix : undefined ,
148151 issue : '9' ,
149152 } ,
153+ { raw : 'Fix: #11' , action : 'Fix' , slug : undefined , prefix : '#' , issue : '11' } ,
150154 ] ,
151155 block : [ ] ,
152156 require : [ ] ,
@@ -167,17 +171,22 @@ test('Parse with default options', t => {
167171test ( 'Parse with custom options' , t => {
168172 t . deepEqual (
169173 m ( {
170- actions : { close : [ 'fix' ] , fix : [ 'fix' ] , duplicate : undefined } ,
174+ actions : { close : [ 'fix' , 'close' ] , fix : [ 'fix' ] , duplicate : undefined } ,
175+ delimiters : [ ':' , '*' ] ,
171176 mentionsPrefixes : '!' ,
172177 issuePrefixes : [ '#' ] ,
173178 hosts : [ 'http://host1.com/' , 'http://host2.com' ] ,
174179 issueURLSegments : [ 'bugs' ] ,
175180 } ) (
176- 'Fix #1 reSOLved gh-2 CLOSES Gh-3 fixed o/r#4 #5 o/r#6 fixing #7 http://host1.com/o/r/bugs/8 http://host2.com/o/r/bugs/9 Duplicate OF #10 !user @other'
181+ 'Fix #1 reSOLved gh-2 CLOSES Gh-3 fixed o/r#4 #5 o/r#6 fixing #7 http://host1.com/o/r/bugs/8 http://host2.com/o/r/bugs/9 Duplicate OF #10 Close:#11 Close* #12 !user @other'
177182 ) ,
178183 {
179184 actions : {
180- close : [ { raw : 'Fix #1' , action : 'Fix' , slug : undefined , prefix : '#' , issue : '1' } ] ,
185+ close : [
186+ { raw : 'Fix #1' , action : 'Fix' , slug : undefined , prefix : '#' , issue : '1' } ,
187+ { raw : 'Close:#11' , action : 'Close' , slug : undefined , prefix : '#' , issue : '11' } ,
188+ { raw : 'Close* #12' , action : 'Close' , slug : undefined , prefix : '#' , issue : '12' } ,
189+ ] ,
181190 fix : [ { raw : 'Fix #1' , action : 'Fix' , slug : undefined , prefix : '#' , issue : '1' } ] ,
182191 block : [ ] ,
183192 require : [ ] ,
0 commit comments