mvp-ai/skill-base / github.com /0xnyk /xint /lib /stream.test.ts
mvp-ai's picture
download
raw
793 Bytes
import { describe, expect, test } from "bun:test";
import { parseBackfillMinutes, parsePositiveInt } from "./stream";
describe("stream arg parsing", () => {
test("parsePositiveInt accepts positive numbers", () => {
expect(parsePositiveInt("7")).toBe(7);
});
test("parsePositiveInt rejects zero/negative/invalid", () => {
expect(parsePositiveInt("0")).toBeNull();
expect(parsePositiveInt("-2")).toBeNull();
expect(parsePositiveInt("abc")).toBeNull();
expect(parsePositiveInt(undefined)).toBeNull();
});
test("parseBackfillMinutes accepts only 1-5", () => {
expect(parseBackfillMinutes("1")).toBe(1);
expect(parseBackfillMinutes("5")).toBe(5);
expect(parseBackfillMinutes("6")).toBeNull();
expect(parseBackfillMinutes("0")).toBeNull();
});
});

Xet Storage Details

Size:
793 Bytes
·
Xet hash:
850ecc7d6887721b2cd5630dd5d3f4187cc790bad791b9687daa63736a0bfc36

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.