mirror of
https://github.com/webiny/action-conventional-commits.git
synced 2024-11-23 10:21:51 +01:00
test: create a basic test
This commit is contained in:
parent
117613fe08
commit
6c26401067
1 changed files with 12 additions and 0 deletions
12
src/__tests__/isValidCommitMessage.test.ts
Normal file
12
src/__tests__/isValidCommitMessage.test.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import isValidCommitMessage from "../isValidCommitMesage";
|
||||
|
||||
test("should be able to correctly validate the commit message", () => {
|
||||
expect(isValidCommitMessage("fix: menu must open on shortcut press")).toBe(true);
|
||||
expect(isValidCommitMessage("something: should not work")).toBe(false);
|
||||
expect(isValidCommitMessage("fixes something")).toBe(false);
|
||||
expect(isValidCommitMessage("🚧 fix: menu must open on shortcut press")).toBe(true);
|
||||
expect(isValidCommitMessage("fix(menus): menu must open on shortcut press")).toBe(true);
|
||||
expect(isValidCommitMessage("🚧 fix(menus): menu must open on shortcut press")).toBe(true);
|
||||
expect(isValidCommitMessage("🚧 fixing something")).toBe(false);
|
||||
expect(isValidCommitMessage("🚧 something: should not work")).toBe(false);
|
||||
});
|
Loading…
Reference in a new issue