mirror of https://github.com/MaxLeiter/Drift
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
352 B
TypeScript
12 lines
352 B
TypeScript
import { timeAgo } from "@lib/time-ago";
|
|
|
|
describe("timeAgo", () => {
|
|
it("should return '1 second ago' for 1 second ago", () => {
|
|
expect(timeAgo(new Date(Date.now() - 1000))).toBe("1 second ago");
|
|
});
|
|
|
|
it("should handle negative values", () => {
|
|
expect(timeAgo(new Date(Date.now() - -1000))).toBe("0 second ago");
|
|
})
|
|
})
|