test: add frontend test suite
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 43s
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 43s
This commit is contained in:
11
src/video.test.ts
Normal file
11
src/video.test.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user