2023-09-14 01:07:07 +02:00
|
|
|
const radiomanifest = require("../radiomanifest.js");
|
|
|
|
const chai = require("chai");
|
|
|
|
chai.use(require("chai-as-promised"));
|
|
|
|
const assert = chai.assert;
|
2021-11-19 17:03:46 +01:00
|
|
|
|
2023-09-14 01:07:07 +02:00
|
|
|
const expect = chai.expect;
|
|
|
|
const tests = ["empty", "empty-no-streaminfo", "empty-invalid-streaminfo"];
|
2022-01-30 00:26:58 +01:00
|
|
|
for (const exampleName of tests) {
|
2023-09-14 01:07:07 +02:00
|
|
|
let url =
|
|
|
|
"https://radiomanifest.degenerazione.xyz/v0.2/examples/" +
|
|
|
|
exampleName +
|
|
|
|
"/";
|
2021-11-19 17:03:46 +01:00
|
|
|
|
2023-09-14 01:07:07 +02:00
|
|
|
describe("examples/" + exampleName, () => {
|
|
|
|
describe("Get radiomanifest", () => {
|
|
|
|
it("should return a Promise", () => {
|
|
|
|
const p = radiomanifest.get(url);
|
|
|
|
expect(p instanceof Promise).to.be.eql(true);
|
|
|
|
});
|
|
|
|
});
|
2021-11-19 17:03:46 +01:00
|
|
|
|
2023-09-14 01:07:07 +02:00
|
|
|
describe("streaming", () => {
|
|
|
|
it("shoud return no streaming option", async () => {
|
|
|
|
const p = await radiomanifest.get(url);
|
|
|
|
expect(p.getStreaming().getOptions().length).to.be.equal(0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2021-12-05 17:40:36 +01:00
|
|
|
}
|