-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.test.js
More file actions
40 lines (37 loc) · 897 Bytes
/
Copy pathindex.test.js
File metadata and controls
40 lines (37 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const main = require('./index');
test('extracts simple keys', () => {
expect(main.getJiraIssueKeys([
"Bla fasel FOO-17 test 1 2 3",
])).toStrictEqual([
"FOO-17"
]);
});
test('extracts at start end end', () => {
expect(main.getJiraIssueKeys([
"FOO-1 Bla fasel test 1 2 3 FOO-2",
])).toStrictEqual([
"FOO-1",
"FOO-2"
]);
});
test('extracts multiple keys', () => {
expect(main.getJiraIssueKeys([
"Bla fasel FOO-17 test FOO-19 1 2 3",
])).toStrictEqual([
"FOO-17",
"FOO-19"
]);
});
test('extracts from conventionalcommit', () => {
expect(main.getJiraIssueKeys([
"fix(FOO-17): do something",
])).toStrictEqual([
"FOO-17"
]);
});
test('doesn\'t match junk', () => {
expect(main.getJiraIssueKeys([
"FOO_17 BAR-0123 BAZ-99a",
])).toStrictEqual([
]);
});