Files
website/src/lib/cs-prices/steam.test.ts
Stan Runge abac077541
All checks were successful
Test and deploy staging / staging (push) Successful in 11m52s
ui changes and cs prices
2026-09-25 00:44:06 +00:00

13 lines
476 B
TypeScript

import { describe, expect, it } from 'vitest';
import { steamDate } from './steam';
describe('Steam market history dates', () => {
it('keeps hourly timestamps and older daily timestamps in UTC', () => {
expect(steamDate('Sep 24 2024 01: +0')).toBe('2024-09-24T01:00:00.000Z');
expect(steamDate('Jan 08 2016')).toBe('2016-01-08T00:00:00.000Z');
});
it('rejects an unknown format', () => {
expect(() => steamDate('not a date')).toThrow('Unknown Steam date');
});
});