refactor tests

This commit is contained in:
boyska 2021-12-05 16:52:19 +01:00 committed by boyska
parent 3bea9b610c
commit 86c58fc39d
2 changed files with 6 additions and 5 deletions

View file

@ -3,11 +3,12 @@ const chai = require('chai')
chai.use(require('chai-as-promised')) chai.use(require('chai-as-promised'))
const assert = chai.assert const assert = chai.assert
const exampleName = 'empty'
const expect = chai.expect 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('examples/' + exampleName, () => {
describe('Get empty radiomanifest', () => { describe('Get radiomanifest', () => {
it('should return a Promise', () => { it('should return a Promise', () => {
const p = radiomanifest.get(url) const p = radiomanifest.get(url)
expect(p instanceof Promise).to.be.eql(true) expect(p instanceof Promise).to.be.eql(true)

View file

@ -7,12 +7,12 @@ const expect = chai.expect
describe('radiomanifest.js', () => { describe('radiomanifest.js', () => {
describe('Get a radiomanifest', () => { describe('Get a radiomanifest', () => {
it('should return a Promise', () => { 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) expect(p instanceof Promise).to.be.eql(true)
}) })
it('should reject on invalid URL', () => { 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 expect(p).to.eventually.be.rejected
}) })
}) })