From e76289a94d020f7140aa7443ad4079f676afe7bb Mon Sep 17 00:00:00 2001 From: hau Date: Wed, 2 Dec 2020 15:48:22 +0700 Subject: [PATCH] test(convetion): unit test for mixedcase types --- pkg/convention/commit_test.go | 12 ++++++++++++ .../testdata/TestNewCommit/Mixedcase.golden | 4 ++++ .../testdata/TestNewCommit/Uppercase.golden | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 pkg/convention/testdata/TestNewCommit/Mixedcase.golden create mode 100644 pkg/convention/testdata/TestNewCommit/Uppercase.golden diff --git a/pkg/convention/commit_test.go b/pkg/convention/commit_test.go index c7e1a21..4d6713d 100644 --- a/pkg/convention/commit_test.go +++ b/pkg/convention/commit_test.go @@ -32,6 +32,18 @@ func TestNewCommit(t *testing.T) { Message: "feat(lang): add polish language", }, }, + { + name: "Uppercase", + c: git.Commit{ + Message: "REFACTOR!: drop support for Node 6", + }, + }, + { + name: "Mixedcase", + c: git.Commit{ + Message: "Docs: correct spelling of CHANGELOG", + }, + }, } for _, tc := range tests { diff --git a/pkg/convention/testdata/TestNewCommit/Mixedcase.golden b/pkg/convention/testdata/TestNewCommit/Mixedcase.golden new file mode 100644 index 0000000..3f34a7d --- /dev/null +++ b/pkg/convention/testdata/TestNewCommit/Mixedcase.golden @@ -0,0 +1,4 @@ +{ + "RawHeader": "Docs: correct spelling of CHANGELOG", + "Type": "docs" +} \ No newline at end of file diff --git a/pkg/convention/testdata/TestNewCommit/Uppercase.golden b/pkg/convention/testdata/TestNewCommit/Uppercase.golden new file mode 100644 index 0000000..d302542 --- /dev/null +++ b/pkg/convention/testdata/TestNewCommit/Uppercase.golden @@ -0,0 +1,4 @@ +{ + "RawHeader": "REFACTOR!: drop support for Node 6", + "Type": "refactor" +} \ No newline at end of file