Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

scheduledTaskWebhook.test.ts

13 lines487 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { parseMaxDeliveryAge } from "./scheduledTaskWebhook.ts";
4​
5describe("parseMaxDeliveryAge", () => {
6 it("treats blank as no limit and rejects values the server would not accept", () => {
7 expect(parseMaxDeliveryAge("")).toBeNull();
8 expect(parseMaxDeliveryAge(" 45 ")).toBe(45);
9 for (const invalid of ["0", "1.5", "-3", "abc", "1441"]) {
10 expect(parseMaxDeliveryAge(invalid)).toBeUndefined();
11 }
12 });
13});