test: add & configure Jest

Fixes #153

Signed-off-by: Ardalan Amini <[email protected]>
This commit is contained in:
Ardalan Amini committed 2024-10-30 14:34:45 +03:30
1 parent 5f05b761d3
commit cce7f4fd60
11 files changed
+2600 -24

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@
*
*/
const REGEX = /^(?<type>[^!:()]*)(?:\((?<scope>[^!()]*?)\)|)(?<breaking>!?): *(?<description>.+?) *(?:\(#(?<pr>[1-9]\d*?)\)|) *(?:\[(?<flag>[^[\]]*?)]|)\s*$/;
const REGEX = /^(?<type>[^!:() ]*)(?:\((?<scope>[^!()]*?)\)|)(?<breaking>!?): *(?<description>.+?) *(?:\(#(?<pr>[1-9]\d*?)\)|) *(?:\[(?<flag>[^[\]]*?)]|)\s*$/;
export function parseCommitMessage(message: string): ParsedCommitMessageI {
const { description, flag, pr, scope, type, breaking } = REGEX.exec(message)?.groups ?? {};