UNPKG

itunes-info

Version:
41 lines (33 loc) 1.34 kB
import chai from 'chai'; import { iTunes } from '../src/itunes'; const expect = chai.expect; describe('iTunes', () => { it('should fetch correct data for: "Avicii - Hey Brother"', (done) => { iTunes.fetch('Avicii - Hey Brother') .then((data) => { expect(data.results.length).to.be.above(0); expect(data.results[0].kind).to.equal('song'); expect(data.results[0].artistName).to.equal('Avicii'); expect(data.results[0].trackName).to.equal('Hey Brother'); done(); }).catch(done); }); it('should fetch correct data for: "Martin Garrix - Animals"', (done) => { iTunes.fetch('Martin Garrix - Animals') .then((data) => { expect(data.results.length).to.be.above(0); expect(data.results[0].kind).to.equal('song'); expect(data.results[0].artistName).to.equal('Martin Garrix'); expect(data.results[0].trackName).to.equal('Animals'); done(); }).catch(done); }); it('should fetch correct data for: "Harry Potter"', (done) => { iTunes.fetch('Harry Potter') .then((data) => { expect(data.results.length).to.be.above(0); expect(data.results[0].kind).to.equal('feature-movie'); done(); }).catch(done); }); });