Skip to content

Commit cf7b1be

Browse files
committed
commitlint: separate tests in 2 files
Strictly speaking, there's one test that is checking that one of the commitlint's native rules works (not a plugin of ours).
1 parent 01b0ecf commit cf7b1be

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

commitlint/integration.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let cp = require("child_process");
2+
3+
function runCommitLintOnMsg(inputMsg: string) {
4+
return cp.spawnSync("npx", ["commitlint", "--verbose"], {
5+
input: inputMsg,
6+
});
7+
}
8+
9+
test("body-leading-blank1", () => {
10+
let commitMsgWithoutEmptySecondLine =
11+
"foo: this is only a title" + "\n" + "Bar baz.";
12+
let bodyLeadingBlank1 = runCommitLintOnMsg(commitMsgWithoutEmptySecondLine);
13+
expect(bodyLeadingBlank1.status).not.toBe(0);
14+
});

commitlint/plugins.test.ts

-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ function runCommitLintOnMsg(inputMsg: string) {
44
return spawnSync("npx", ["commitlint", "--verbose"], { input: inputMsg });
55
}
66

7-
test("body-leading-blank1", () => {
8-
let commitMsgWithoutEmptySecondLine =
9-
"foo: this is only a title" + "\n" + "Bar baz.";
10-
let bodyLeadingBlank1 = runCommitLintOnMsg(commitMsgWithoutEmptySecondLine);
11-
expect(bodyLeadingBlank1.status).not.toBe(0);
12-
});
13-
147
test("body-prose1", () => {
158
let commitMsgWithLowercaseBodyStart =
169
"foo: this is only a title" + "\n\n" + "bla blah bla.";

0 commit comments

Comments
 (0)