test: create a basic test

This commit is contained in:
Adrian Smijulj 2020-06-11 12:51:50 +02:00
parent 117613fe08
commit 6c26401067

View 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);
});