Skip to content

Commit f959a32

Browse files
aspiersAdam Spiers
authored andcommitted
fix(rules): correct multi-line tests for body-max-line-length
Previously the multi-line test fixtures in the test suite for the `body-max-line-length` rule were defined but never used; instead, the single line fixtures were being used in tests supposed to test multi-line commit messages. This was presumably an innocent copy-and-paste error, so fix the multi-line tests to use the multi-line fixtures.
1 parent be7bbca commit f959a32

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

@commitlint/rules/src/body-max-line-length.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const parsed = {
1919
empty: parse(messages.empty),
2020
short: parse(messages.short),
2121
long: parse(messages.long),
22+
shortMultipleLines: parse(messages.shortMultipleLines),
23+
longMultipleLines: parse(messages.longMultipleLines),
2224
};
2325

2426
test("with empty should succeed", async () => {
@@ -40,13 +42,21 @@ test("with long should fail", async () => {
4042
});
4143

4244
test("with short with multiple lines should succeed", async () => {
43-
const [actual] = bodyMaxLineLength(await parsed.short, undefined, value);
45+
const [actual] = bodyMaxLineLength(
46+
await parsed.shortMultipleLines,
47+
undefined,
48+
value
49+
);
4450
const expected = true;
4551
expect(actual).toEqual(expected);
4652
});
4753

4854
test("with long with multiple lines should fail", async () => {
49-
const [actual] = bodyMaxLineLength(await parsed.long, undefined, value);
55+
const [actual] = bodyMaxLineLength(
56+
await parsed.longMultipleLines,
57+
undefined,
58+
value
59+
);
5060
const expected = false;
5161
expect(actual).toEqual(expected);
5262
});

0 commit comments

Comments
 (0)