rx-player
Version:
Canal+ HTML5 Video Player
26 lines (22 loc) • 730 B
text/typescript
import { describe, it, expect } from "vitest";
import type { IManifest } from "../../../../../manifest";
import parseFromString from "../parse_from_xml_string";
describe("parseFromString", () => {
it("throws root if not MPD", function () {
const xml = "<foo></foo>";
expect(function () {
parseFromString(xml, {
url: "",
externalClockOffset: 10,
unsafelyBaseOnPreviousManifest: null,
});
}).toThrow("document root should be MPD");
expect(function () {
const prevManifest = {} as unknown as IManifest;
parseFromString(xml, {
url: "",
unsafelyBaseOnPreviousManifest: prevManifest,
});
}).toThrow("document root should be MPD");
});
});