beeeeg update
Some checks failed
Test and deploy staging / staging (push) Has been cancelled

This commit is contained in:
2026-09-23 04:15:10 +00:00
parent 487eff5bb2
commit d0c7b6548b
135 changed files with 9531 additions and 1777 deletions

View File

@@ -0,0 +1,12 @@
import { describe, expect, it } from 'vitest';
import { relativeTime } from './relative-time';
describe('relativeTime', () => {
it('uses readable singular and plural dates', () => {
const now = Date.UTC(2026, 8, 23);
expect(relativeTime(new Date(now - 1000), now)).toBe('just now');
expect(relativeTime(new Date(now - 1000 * 30), now)).toBe('30 seconds ago');
expect(relativeTime(new Date(now - 1000 * 60 * 60), now)).toBe('an hour ago');
expect(relativeTime(new Date(now - 1000 * 60 * 60 * 24 * 365), now)).toBe('a year ago');
});
});