Switch to Koa, more es6

This commit is contained in:
Jonathan Cremin 2015-06-03 21:45:54 -07:00
parent 1090affc9c
commit b3abff99ae
36 changed files with 25573 additions and 928 deletions

View file

@ -1,41 +1,30 @@
"use strict";
var assert = require("assert");
var should = require('should');
var rdio = require("../../lib/services/rdio");
import 'should';
import rdio from '../../lib/services/rdio';
describe('Rdio', function(){
describe('lookupId', function(){
it('should find album by ID', function(done){
rdio.lookupId("Qj4NXr0").then(function(result) {
result.name.should.equal("Listen (Deluxe)");
done();
});
it('should find album by ID', function* (){
let result = yield rdio.lookupId('Qj4NXr0');
result.name.should.equal('Listen (Deluxe)');
});
});
describe('search', function(){
it('should find album by search', function(done){
rdio.search({type: "album", artist: {name: "David Guetta"}, name: "Listen (Deluxe)"}).then(function(result) {
result.name.should.equal("Listen (Deluxe)");
done();
});
it('should find album by search', function* (){
let result = yield rdio.search({type: 'album', artist: {name: 'David Guetta'}, name: 'Listen (Deluxe)'});
result.name.should.equal('Listen (Deluxe)');
});
});
describe('parseUrl', function(){
it('should parse regular url into album object', function(done){
rdio.parseUrl("https://www.rdio.com/artist/David_Guetta/album/Listen_(Deluxe)/").then(function(result) {
result.name.should.equal("Listen (Deluxe)");
done();
});
it('should parse regular url into album object', function* (){
let result = yield rdio.parseUrl('https://www.rdio.com/artist/David_Guetta/album/Listen_(Deluxe)/');
result.name.should.equal('Listen (Deluxe)');
});
it('should parse short url into album object', function(done){
rdio.parseUrl("http://rd.io/x/Qj4NXr0/").then(function(result) {
result.name.should.equal("Listen (Deluxe)");
done();
});
it('should parse short url into album object', function* (){
let result = yield rdio.parseUrl('http://rd.io/x/Qj4NXr0/');
result.name.should.equal('Listen (Deluxe)');
});
});
});