File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,16 @@ export default (parsed, when) => {
6
6
7
7
const negated = when === 'never' ;
8
8
9
- // get complete body split into lines
10
- const lines = ( parsed . raw || '' ) . split ( / \r | \n / ) . slice ( 2 ) ;
9
+ const count = ( parsed . body || '' ) . split ( / \r | \n / ) . length ;
10
+
11
+ // get complete message split into lines
12
+ const lines = ( parsed . raw || '' )
13
+ . split ( / \r | \n / )
14
+ . slice ( count + 1 ) ;
15
+
11
16
const [ leading ] = lines ;
12
17
13
- // check if the first line of body is empty
18
+ // check if the first line of footer is empty
14
19
const succeeds = leading === '' ;
15
20
16
21
return [
Original file line number Diff line number Diff line change @@ -110,19 +110,19 @@ test('with blank line before footer should succeed for "always"', t => {
110
110
t . is ( actual , expected ) ;
111
111
} ) ;
112
112
113
- test . failing ( 'with blank line before footer and multiline body should succeed for empty keyword' , t => {
113
+ test ( 'with blank line before footer and multiline body should succeed for empty keyword' , t => {
114
114
const [ actual ] = footerLeadingBlank ( parsed . withMulitLine ) ;
115
115
const expected = true ;
116
116
t . is ( actual , expected ) ;
117
117
} ) ;
118
118
119
- test . failing ( 'with blank line before footer and multiline body should fail for "never"' , t => {
119
+ test ( 'with blank line before footer and multiline body should fail for "never"' , t => {
120
120
const [ actual ] = footerLeadingBlank ( parsed . withMulitLine , 'never' ) ;
121
121
const expected = false ;
122
122
t . is ( actual , expected ) ;
123
123
} ) ;
124
124
125
- test . failing ( 'with blank line before footer and multiline body should succeed for "always"' , t => {
125
+ test ( 'with blank line before footer and multiline body should succeed for "always"' , t => {
126
126
const [ actual ] = footerLeadingBlank ( parsed . withMulitLine , 'always' ) ;
127
127
const expected = true ;
128
128
t . is ( actual , expected ) ;
You can’t perform that action at this time.
0 commit comments