Proyecto App Linux

This commit is contained in:
2026-05-03 23:43:09 +02:00
commit 7482733843
1248 changed files with 189750 additions and 0 deletions
@@ -0,0 +1,27 @@
import { normalizeStalkerDate } from './stalker-item.normalizer';
describe('normalizeStalkerDate', () => {
it('normalizes SQLite UTC timestamps without relying on engine-specific parsing', () => {
const originalParse = Date.parse;
const parseSpy = jest
.spyOn(Date, 'parse')
.mockImplementation((value: string) => {
if (value === '2026-04-21 22:49:02') {
return Number.NaN;
}
return originalParse(value);
});
expect(normalizeStalkerDate('2026-04-21 22:49:02')).toBe(
'2026-04-21T22:49:02.000Z'
);
expect(parseSpy).not.toHaveBeenCalledWith('2026-04-21 22:49:02');
});
it('preserves fractional seconds in SQLite UTC timestamps', () => {
expect(normalizeStalkerDate('2026-04-21 22:49:02.7')).toBe(
'2026-04-21T22:49:02.700Z'
);
});
});