Skip to content

Commit

Permalink
commitlint: separate tests in 2 files
Browse files Browse the repository at this point in the history
Strictly speaking, there's one test that is checking that
one of the commitlint's native rules works (not a plugin
of ours).
  • Loading branch information
knocte committed Feb 14, 2023
1 parent 01b0ecf commit cf7b1be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 14 additions & 0 deletions commitlint/integration.test.ts
@@ -0,0 +1,14 @@
let cp = require("child_process");

function runCommitLintOnMsg(inputMsg: string) {
return cp.spawnSync("npx", ["commitlint", "--verbose"], {
input: inputMsg,
});
}

test("body-leading-blank1", () => {
let commitMsgWithoutEmptySecondLine =
"foo: this is only a title" + "\n" + "Bar baz.";
let bodyLeadingBlank1 = runCommitLintOnMsg(commitMsgWithoutEmptySecondLine);
expect(bodyLeadingBlank1.status).not.toBe(0);
});
7 changes: 0 additions & 7 deletions commitlint/plugins.test.ts
Expand Up @@ -4,13 +4,6 @@ function runCommitLintOnMsg(inputMsg: string) {
return spawnSync("npx", ["commitlint", "--verbose"], { input: inputMsg });
}

test("body-leading-blank1", () => {
let commitMsgWithoutEmptySecondLine =
"foo: this is only a title" + "\n" + "Bar baz.";
let bodyLeadingBlank1 = runCommitLintOnMsg(commitMsgWithoutEmptySecondLine);
expect(bodyLeadingBlank1.status).not.toBe(0);
});

test("body-prose1", () => {
let commitMsgWithLowercaseBodyStart =
"foo: this is only a title" + "\n\n" + "bla blah bla.";
Expand Down

0 comments on commit cf7b1be

Please sign in to comment.