All checks were successful
Test and deploy staging / staging (push) Successful in 11m52s
13 lines
476 B
TypeScript
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');
|
|
});
|
|
});
|