-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from levigo/feature/find_multiple_issue_keys
feature/find_multiple_issue_keys
- Loading branch information
Showing
4 changed files
with
6,250 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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([ | ||
]); | ||
}); |
Oops, something went wrong.