Skip to content

Commit e314d5b

Browse files
committed
test: add multiline body cases for footer-leading-blank
1 parent 1fdbdae commit e314d5b

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

source/rules/footer-leading-blank.test.js

+22-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ const messages = {
77
body: 'chore: subject\nbody',
88
trailing: 'chore: subject\nbody\n\n',
99
without: 'chore: subject\nbody\nBREAKING CHANGE: something important',
10-
with: 'chore: subject\nbody\n\nBREAKING CHANGE: something important'
10+
with: 'chore: subject\nbody\n\nBREAKING CHANGE: something important',
11+
withMulitLine: 'chore: subject\nmulti\nline\nbody\n\nBREAKING CHANGE: something important'
1112
};
1213

1314
const parsed = {
1415
simple: parse(messages.simple),
1516
body: parse(messages.body),
1617
trailing: parse(messages.trailing),
1718
without: parse(messages.without),
18-
with: parse(messages.with)
19+
with: parse(messages.with),
20+
withMulitLine: parse(messages.withMulitLine)
1921
};
2022

2123
test('with simple message should succeed for empty keyword', t => {
@@ -107,3 +109,21 @@ test('with blank line before footer should succeed for "always"', t => {
107109
const expected = true;
108110
t.is(actual, expected);
109111
});
112+
113+
test.failing('with blank line before footer and multiline body should succeed for empty keyword', t => {
114+
const [actual] = footerLeadingBlank(parsed.withMulitLine);
115+
const expected = true;
116+
t.is(actual, expected);
117+
});
118+
119+
test.failing('with blank line before footer and multiline body should fail for "never"', t => {
120+
const [actual] = footerLeadingBlank(parsed.withMulitLine, 'never');
121+
const expected = false;
122+
t.is(actual, expected);
123+
});
124+
125+
test.failing('with blank line before footer and multiline body should succeed for "always"', t => {
126+
const [actual] = footerLeadingBlank(parsed.withMulitLine, 'always');
127+
const expected = true;
128+
t.is(actual, expected);
129+
});

0 commit comments

Comments
 (0)