From cec6cb9101ce997d4094aacf4308e37690d22631 Mon Sep 17 00:00:00 2001 From: boyska Date: Sun, 5 Dec 2021 16:52:32 +0100 Subject: [PATCH] new tests for source404 --- test/example-source404.test.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/example-source404.test.js diff --git a/test/example-source404.test.js b/test/example-source404.test.js new file mode 100644 index 0000000..041a180 --- /dev/null +++ b/test/example-source404.test.js @@ -0,0 +1,23 @@ +const radiomanifest = require('../radiomanifest.js') +const chai = require('chai') +chai.use(require('chai-as-promised')) +const assert = chai.assert + +const exampleName = 'source404' +const expect = chai.expect +const url = 'https://boyska.degenerazione.xyz/radiomanifest/examples/' + exampleName + '/' + +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') + }) + }) +})