init
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import dayjs from '../plugins/dayjs';
|
||||
import { formatRelativeTimeAgo } from './formatRelativeTimeAgo';
|
||||
|
||||
describe('formatRelativeTimeAgo', () => {
|
||||
it('formats a relative time from the provided now date', () => {
|
||||
const now = new Date('2026-01-02T12:00:00.000Z');
|
||||
const earlier = new Date('2026-01-02T11:00:00.000Z');
|
||||
|
||||
expect(formatRelativeTimeAgo(earlier, now)).toBe(dayjs(earlier).from(dayjs(now)));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user