Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

721 B
Raw Blame
import { describe, expect, it } from 'vitest';

import { normalizeServerTimestamp } from './serverTimestamp';

describe('normalizeServerTimestamp', () => {
  it('parses naive SQLite timestamps as UTC', () => {
    expect(normalizeServerTimestamp('2026-06-11 09:21:04.123')).toBe('2026-06-11T09:21:04.123Z');
  });

  it('passes ISO timestamps through unchanged', () => {
    expect(normalizeServerTimestamp('2026-06-11T09:21:04.123Z')).toBe('2026-06-11T09:21:04.123Z');
  });

  it('passes unparseable values through unchanged', () => {
    expect(normalizeServerTimestamp('not a timestamp')).toBe('not a timestamp');
    expect(normalizeServerTimestamp('2026-06-11 not-a-time')).toBe('2026-06-11 not-a-time');
  });
});