mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 02:45:22 -08:00
#83 - Use non-capturing optional group, add tests and update dist
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
export function parseNetDuration(str: string): number {
|
||||
// matches dotnet duration: 00:00:00.0010000
|
||||
const durationRe = /^(\d\d):(\d\d):(\d\d($|\.\d+$))/
|
||||
const durationRe = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)$/
|
||||
const durationMatch = str.match(durationRe)
|
||||
if (durationMatch === null) {
|
||||
throw new Error(`Invalid format: "${str}" is not NET duration`)
|
||||
|
||||
Reference in New Issue
Block a user