Skip to content

Commit 705f8a2

Browse files
committed
test: add footer-maker breakingChangeFilterFactory test
1 parent 6496b20 commit 705f8a2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/prompts/footer-maker.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { QualifiedRules, RuleConfigSeverity } from '@commitlint/types';
2+
import { breakingChangeFilterFactory } from './footer-maker';
3+
4+
describe('footerMaker', () => {
5+
describe('breakingChangeFilterFactory', () => {
6+
it('should break in footer when exceeding maximum specified line length', () => {
7+
const rules: QualifiedRules = { 'footer-max-line-length': [RuleConfigSeverity.Error, 'always', 11] };
8+
const fixture = breakingChangeFilterFactory(rules, 'BREAKING CHANGE: ')!;
9+
10+
const result = fixture('Lorem ipsum dolor sit amet, consectetur adipisicing elit.', {});
11+
12+
expect(result).toBe(`BREAKING \nCHANGE: \nLorem ipsum \ndolor sit \namet, \nconsectetur \nadipisicing \nelit.`);
13+
});
14+
});
15+
});

0 commit comments

Comments
 (0)