task-helpers.test.js
1 import { describe, expect, it } from 'vitest'; 2 import { parsePeekLimit } from './task-helpers.js'; 3 describe('parsePeekLimit', () => { 4 it('returns the fallback when the input is not numeric', () => { 5 expect(parsePeekLimit('abc', 30)).toBe(30); 6 }); 7 it('clamps the input into the supported range', () => { 8 expect(parsePeekLimit('0', 30)).toBe(30); 9 expect(parsePeekLimit('999', 30)).toBe(500); 10 expect(parsePeekLimit('42', 30)).toBe(42); 11 }); 12 });