Skip to content

Commit 248010b

Browse files
committed
fix(core): harden to-lines typecheck
1 parent d24404a commit 248010b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: @commitlint/core/src/library/to-lines.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default function toLines(input) {
2-
if (typeof input === 'undefined') {
2+
if (typeof input !== 'string') {
33
return [];
44
}
55

Diff for: @commitlint/core/src/library/to-lines.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test('should return an array for empty input', t => {
55
t.deepEqual(toLines(), []);
66
});
77

8-
test.failing('should return an array for null input', t => {
8+
test('should return an array for null input', t => {
99
t.deepEqual(toLines(null), []);
1010
});
1111

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ test('with trailing message should succeed for "always"', async t => {
7878
t.is(actual, expected);
7979
});
8080

81-
test.failing('without body should succeed for "never"', async t => {
81+
test('without body should fail for "never"', async t => {
8282
const [actual] = footerLeadingBlank(await parsed.withoutBody, 'never');
83-
const expected = true;
83+
const expected = false;
8484
t.is(actual, expected);
8585
});
8686

87-
test.failing('without body should succeed for "always"', async t => {
87+
test('without body should succeed for "always"', async t => {
8888
const [actual] = footerLeadingBlank(await parsed.withoutBody, 'always');
8989
const expected = true;
9090
t.is(actual, expected);

0 commit comments

Comments
 (0)