|
1 | 1 | 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 | + }) |
3 | 20 |
|
4 | | -describe("Split a message into components", function () { |
5 | 21 | describe("#splitMsg", function () { |
6 | 22 | it("handles a description alone", function () { |
7 | 23 | assert.deepStrictEqual(splitMsg("abc def"), { |
8 | 24 | customPrefix: "", |
9 | 25 | typePrefix: "", |
10 | 26 | description: "abc def", |
11 | 27 | }); |
| 28 | + }) |
| 29 | + |
| 30 | + it("handles a Jira prefix alone", function () { |
12 | 31 | assert.deepStrictEqual(splitMsg("[ABCD-1234]"), { |
13 | 32 | customPrefix: "", |
14 | 33 | typePrefix: "", |
15 | 34 | description: "[ABCD-1234]", |
16 | 35 | }); |
17 | 36 | }); |
18 | 37 |
|
19 | | - it("handles a prefix alone", function () { |
| 38 | + it("handles a type prefix alone", function () { |
20 | 39 | assert.deepStrictEqual(splitMsg("docs:"), { |
21 | 40 | customPrefix: "", |
22 | 41 | typePrefix: "docs", |
|
0 commit comments