example-empty.test.js 849 B

1234567891011121314151617181920212223242526
  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 = 'https://radiomanifest.degenerazione.xyz/v0.2/examples/' + exampleName + '/'
  9. describe('examples/' + exampleName, () => {
  10. describe('Get radiomanifest', () => {
  11. it('should return a Promise', () => {
  12. const p = radiomanifest.get(url)
  13. expect(p instanceof Promise).to.be.eql(true)
  14. })
  15. })
  16. describe('streaming', () => {
  17. it('shoud return no streaming option', async () => {
  18. const p = await radiomanifest.get(url)
  19. expect(p.getStreaming().getOptions().length).to.be.equal(0)
  20. })
  21. })
  22. })
  23. }