Add more async

This commit is contained in:
Jonathan Cremin 2018-04-30 22:20:01 +01:00
parent 7be2b7b97a
commit 8ea8b4d279
14 changed files with 108 additions and 300 deletions

View file

@ -3,30 +3,30 @@ import * as amazon from '../../lib/services/amazon';
describe('Amazon', function () {
describe('lookupId', function () {
it('should find album by ID', function* () {
const result = yield amazon.lookupId('B00V8I134A', 'album');
it('should find album by ID', async function () {
const result = await amazon.lookupId('B00V8I134A', 'album');
result.name.should.equal('In Colour [Explicit]');
});
it('should find track by ID', function* (){
const result = yield amazon.lookupId('B00V8I1CKU', 'track');
it('should find track by ID', async function () {
const result = await amazon.lookupId('B00V8I1CKU', 'track');
result.name.should.equal('Sleep Sound');
});
});
describe('search', function(){
it('should find album by search', function* () {
const result = yield amazon.search({type: 'album', artist: {name: 'Jamie xx'}, name: 'In Colour'});
it('should find album by search', async function () {
const result = await amazon.search({type: 'album', artist: {name: 'Jamie xx'}, name: 'In Colour'});
result.name.should.equal('In Colour [Explicit]');
});
it('should find track by search', function* (){
const result = yield amazon.search({type: 'track', artist: {name: 'Jamie xx'}, albumName: 'In Colour', name: 'Loud Places'});
it('should find track by search', async function () {
const result = await amazon.search({type: 'track', artist: {name: 'Jamie xx'}, albumName: 'In Colour', name: 'Loud Places'});
result.name.should.equal('Loud Places');
});
it('should find awkward track by search', function* (){
const result = yield amazon.search({type: 'track', artist: {name: 'Jamie xx'}, albumName: 'In Colour (Remixes)', name: 'Loud Places [Tessela Remix]'});
it('should find awkward track by search', async function () {
const result = await amazon.search({type: 'track', artist: {name: 'Jamie xx'}, albumName: 'In Colour (Remixes)', name: 'Loud Places [Tessela Remix]'});
result.name.should.equal('Loud Places [Tessela Remix]');
});
});