Skip to content

Commit 9556d46

Browse files
committed
test: update parseExisting.test.ts - add cases
1 parent 8d4cf2c commit 9556d46

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

src/test/generate/parseExisting.test.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
import * as assert from "assert";
2-
import { splitMsg } from "../../generate/parseExisting";
2+
import { splitMsg, _splitPrefixDesc } from "../../generate/parseExisting";
3+
4+
describe("Split an existing message into components", function () {
5+
describe("#_splitPrefixDesc", function () {
6+
it("handles a description alone", function () {
7+
assert.deepStrictEqual(_splitPrefixDesc("abc def"), {
8+
prefix: "",
9+
description: "abc def",
10+
});
11+
})
12+
13+
it("handles a Jira prefix alone", function () {
14+
assert.deepStrictEqual(_splitPrefixDesc("[ABCD-1234]"), {
15+
prefix: "",
16+
description: "[ABCD-1234]",
17+
});
18+
});
19+
})
320

4-
describe("Split a message into components", function () {
521
describe("#splitMsg", function () {
622
it("handles a description alone", function () {
723
assert.deepStrictEqual(splitMsg("abc def"), {
824
customPrefix: "",
925
typePrefix: "",
1026
description: "abc def",
1127
});
28+
})
29+
30+
it("handles a Jira prefix alone", function () {
1231
assert.deepStrictEqual(splitMsg("[ABCD-1234]"), {
1332
customPrefix: "",
1433
typePrefix: "",
1534
description: "[ABCD-1234]",
1635
});
1736
});
1837

19-
it("handles a prefix alone", function () {
38+
it("handles a type prefix alone", function () {
2039
assert.deepStrictEqual(splitMsg("docs:"), {
2140
customPrefix: "",
2241
typePrefix: "docs",

0 commit comments

Comments
 (0)