radiomanifest.js/test/example-source404.test.js

28 lines
918 B
JavaScript
Raw Permalink Normal View History

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-12-05 16:52:32 +01:00
2023-09-14 01:07:07 +02:00
const exampleName = "source404";
const expect = chai.expect;
const url =
"https://radiomanifest.degenerazione.xyz/v0.2/examples/" + exampleName + "/";
2021-12-05 16:52:32 +01:00
2023-09-14 01:07:07 +02:00
describe("examples/" + exampleName, () => {
describe("streaming", () => {
it("shoud return one streaming option", async () => {
const p = await radiomanifest.get(url);
assert.equal(p.getStreaming().getOptions().length, 1);
});
it("... whose url is stream.m3u", async () => {
const p = await radiomanifest.get(url);
assert.equal(p.getStreaming().getOptions()[0], "try to find me");
const name = p.getStreaming().getOptions()[0];
assert.equal(
p.getStreaming().getSource(name),
"https://www.radioexample.org/stream.m3u",
);
});
});
});