12 lines
484 B
TypeScript
12 lines
484 B
TypeScript
|
|
import { describe, expect, it } from "vitest";
|
||
|
|
import { isLikelyVideoPath } from "./video";
|
||
|
|
|
||
|
|
describe("isLikelyVideoPath", () => {
|
||
|
|
it("detects common video extensions and ignores query strings", () => {
|
||
|
|
expect(isLikelyVideoPath("/uploads/intro.MP4?token=1")).toBe(true);
|
||
|
|
expect(isLikelyVideoPath("https://cdn.example.com/demo.webm")).toBe(true);
|
||
|
|
expect(isLikelyVideoPath("/uploads/file.pdf")).toBe(false);
|
||
|
|
expect(isLikelyVideoPath(undefined)).toBe(false);
|
||
|
|
});
|
||
|
|
});
|