Skip to content

Commit 6565ab1

Browse files
committed
test(core): add failing tests for regression related to to-lines
1 parent 0b3a517 commit 6565ab1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

@commitlint/core/src/rules/footer-leading-blank.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const messages = {
77
body: 'chore: subject\nbody',
88
trailing: 'chore: subject\nbody\n\n',
99
without: 'chore: subject\nbody\nBREAKING CHANGE: something important',
10+
withoutBody:
11+
'feat(new-parser): introduces a new parsing library\n\nBREAKING CHANGE: new library does not support foo-construct',
1012
with: 'chore: subject\nbody\n\nBREAKING CHANGE: something important',
1113
withMulitLine:
1214
'chore: subject\nmulti\nline\nbody\n\nBREAKING CHANGE: something important'
@@ -17,6 +19,7 @@ const parsed = {
1719
body: parse(messages.body),
1820
trailing: parse(messages.trailing),
1921
without: parse(messages.without),
22+
withoutBody: parse(messages.withoutBody),
2023
with: parse(messages.with),
2124
withMulitLine: parse(messages.withMulitLine)
2225
};
@@ -75,6 +78,18 @@ test('with trailing message should succeed for "always"', async t => {
7578
t.is(actual, expected);
7679
});
7780

81+
test.failing('without body should succeed for "never"', async t => {
82+
const [actual] = footerLeadingBlank(await parsed.withoutBody, 'never');
83+
const expected = true;
84+
t.is(actual, expected);
85+
});
86+
87+
test.failing('without body should succeed for "always"', async t => {
88+
const [actual] = footerLeadingBlank(await parsed.withoutBody, 'always');
89+
const expected = true;
90+
t.is(actual, expected);
91+
});
92+
7893
test('without blank line before footer should fail for empty keyword', async t => {
7994
const [actual] = footerLeadingBlank(await parsed.without);
8095
const expected = false;

0 commit comments

Comments
 (0)