add tests
This commit is contained in:
parent
74fdfb7626
commit
2fcca576a6
1 changed files with 14 additions and 0 deletions
|
@ -111,4 +111,18 @@ describe("Relative time", () => {
|
|||
expect(timeDeltaToString(name)).toMatch(/1w 1d 6h|1w 1d 5h 59m 5\ds/);
|
||||
});
|
||||
}
|
||||
{
|
||||
// We do +2 because we do -2 in the code to compensate for Discord's latency.
|
||||
// This gives us the case where (normally) there is a 0s delay.
|
||||
const name = Date.now() + 2 * 1000;
|
||||
test(name.toString(), () => {
|
||||
expect(timeDeltaToString(name)).toMatch(/\ds/);
|
||||
});
|
||||
}
|
||||
{
|
||||
const name = Date.now();
|
||||
test(name.toString(), () => {
|
||||
expect(timeDeltaToString(name)).toMatch(/\ds/);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue