diff --git a/src/utility/getUrlExtension.test.ts b/src/utility/getUrlExtension.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c9028da8e8d1b9df8d90c470a8e949cad63142f --- /dev/null +++ b/src/utility/getUrlExtension.test.ts @@ -0,0 +1,12 @@ +import { describe, test, expect } from "vitest"; +import getUrlExtension from "./getUrlExtension"; + +describe("getUrlExtension", () => { + test("should return the extension of a url", () => { + expect(getUrlExtension("https://example.com/file.mp3")).toBe("mp3"); + }); + + test("should return the extension of a url with params", () => { + expect(getUrlExtension("https://example.com/file.mp3?key=value&key2=.mpegvalue")).toBe("mp3"); + }); +});