radiomanifest.js/test/example-empty.test.js
2023-09-14 00:07:13 +01:00

29 lines
877 B
JavaScript

const radiomanifest = require("../radiomanifest.js");
const chai = require("chai");
chai.use(require("chai-as-promised"));
const assert = chai.assert;
const expect = chai.expect;
const tests = ["empty", "empty-no-streaminfo", "empty-invalid-streaminfo"];
for (const exampleName of tests) {
let url =
"https://radiomanifest.degenerazione.xyz/v0.2/examples/" +
exampleName +
"/";
describe("examples/" + exampleName, () => {
describe("Get radiomanifest", () => {
it("should return a Promise", () => {
const p = radiomanifest.get(url);
expect(p instanceof Promise).to.be.eql(true);
});
});
describe("streaming", () => {
it("shoud return no streaming option", async () => {
const p = await radiomanifest.get(url);
expect(p.getStreaming().getOptions().length).to.be.equal(0);
});
});
});
}