import { describe, expect, it } from 'vitest';
import { parseDuration } from './duration.js';

describe('parseDuration', () => {
  it('parses minutes', () => {
    expect(parseDuration('15m')).toBe(900000);
  });

  it('parses days', () => {
    expect(parseDuration('2d')).toBe(172800000);
  });

  it('throws on invalid strings', () => {
    expect(() => parseDuration('tomorrow')).toThrow();
  });
});
