test: check output value range
This commit is contained in:
parent
a70b284b7c
commit
0c22e01397
1 changed files with 2 additions and 0 deletions
|
@ -89,6 +89,8 @@ describe("getAge tests", () => {
|
||||||
["2023-07-31 00:00:00.000+09:00", 0.00273224043715847],
|
["2023-07-31 00:00:00.000+09:00", 0.00273224043715847],
|
||||||
])("ageDecimal to work for '%s'", (date, expected) => {
|
])("ageDecimal to work for '%s'", (date, expected) => {
|
||||||
expect(ageDecimal(dayjs(date))).toEqual(expected)
|
expect(ageDecimal(dayjs(date))).toEqual(expected)
|
||||||
|
expect(ageDecimal(dayjs(date))).toBeGreaterThanOrEqual(0.0)
|
||||||
|
expect(ageDecimal(dayjs(date))).toBeLessThan(1.0)
|
||||||
})
|
})
|
||||||
|
|
||||||
test.each<[string, number]>([
|
test.each<[string, number]>([
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue