forked from boyska/radiomanifest.js
refactor tests
This commit is contained in:
parent
3bea9b610c
commit
86c58fc39d
2 changed files with 6 additions and 5 deletions
|
@ -3,11 +3,12 @@ const chai = require('chai')
|
|||
chai.use(require('chai-as-promised'))
|
||||
const assert = chai.assert
|
||||
|
||||
const exampleName = 'empty'
|
||||
const expect = chai.expect
|
||||
const url = 'https://boyska.degenerazione.xyz/radiomanifest/examples/empty/'
|
||||
const url = 'https://boyska.degenerazione.xyz/radiomanifest/examples/' + exampleName + '/'
|
||||
|
||||
describe('radiomanifest.js', () => {
|
||||
describe('Get empty radiomanifest', () => {
|
||||
describe('examples/' + exampleName, () => {
|
||||
describe('Get radiomanifest', () => {
|
||||
it('should return a Promise', () => {
|
||||
const p = radiomanifest.get(url)
|
||||
expect(p instanceof Promise).to.be.eql(true)
|
||||
|
|
|
@ -7,12 +7,12 @@ const expect = chai.expect
|
|||
describe('radiomanifest.js', () => {
|
||||
describe('Get a radiomanifest', () => {
|
||||
it('should return a Promise', () => {
|
||||
const p = radiomanifest.get('http://omstring')
|
||||
const p = radiomanifest.get('http://example.com/')
|
||||
expect(p instanceof Promise).to.be.eql(true)
|
||||
})
|
||||
|
||||
it('should reject on invalid URL', () => {
|
||||
const p = radiomanifest.get('http://invalidurl')
|
||||
const p = radiomanifest.get('http://example.com/')
|
||||
expect(p).to.eventually.be.rejected
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue