example-empty.test.js 877 B

1234567891011121314151617181920212223242526272829
  1. const radiomanifest = require("../radiomanifest.js");
  2. const chai = require("chai");
  3. chai.use(require("chai-as-promised"));
  4. const assert = chai.assert;
  5. const expect = chai.expect;
  6. const tests = ["empty", "empty-no-streaminfo", "empty-invalid-streaminfo"];
  7. for (const exampleName of tests) {
  8. let url =
  9. "https://radiomanifest.degenerazione.xyz/v0.2/examples/" +
  10. exampleName +
  11. "/";
  12. describe("examples/" + exampleName, () => {
  13. describe("Get radiomanifest", () => {
  14. it("should return a Promise", () => {
  15. const p = radiomanifest.get(url);
  16. expect(p instanceof Promise).to.be.eql(true);
  17. });
  18. });
  19. describe("streaming", () => {
  20. it("shoud return no streaming option", async () => {
  21. const p = await radiomanifest.get(url);
  22. expect(p.getStreaming().getOptions().length).to.be.equal(0);
  23. });
  24. });
  25. });
  26. }