Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
- Loading branch information
1 parent
50d81e4
commit 287e129
Showing
5 changed files
with
145 additions
and
31 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
Empty file.
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,15 @@ | ||
import { isValidPrometheusDuration } from './time'; | ||
|
||
describe('isValidPrometheusDuration', () => { | ||
const validDurations = ['20h30m10s45ms', '1m30s', '20s4h', '90s', '10s', '20h20h', '2d4h20m']; | ||
|
||
it.each(validDurations)('%s should be valid', (duration) => { | ||
expect(isValidPrometheusDuration(duration)).toBe(true); | ||
}); | ||
|
||
const invalidDurations = ['20h 30m 10s 45ms', '10Y', 'sample text', 'm']; | ||
|
||
it.each(invalidDurations)('%s should NOT be valid', (duration) => { | ||
expect(isValidPrometheusDuration(duration)).toBe(false); | ||
}); | ||
}); |
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