test: add test for getSpotifyPlaylist
This commit is contained in:
parent
81aa88f889
commit
d6534ecb05
1122
package-lock.json
generated
1122
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,7 @@
|
|||
"description": "Download Spotify playlist as mp3 from VKontakte",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "mocha"
|
||||
},
|
||||
"bin": {
|
||||
"vk-music-dl": "./index.js"
|
||||
|
@ -36,5 +36,7 @@
|
|||
"node-fetch": "^2.6.0",
|
||||
"promisepipe": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {}
|
||||
"devDependencies": {
|
||||
"mocha": "^8.1.3"
|
||||
}
|
||||
}
|
||||
|
|
14
test/lib.test.js
Normal file
14
test/lib.test.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
const assert = require('assert');
|
||||
const {getSpotifyPlaylist} = require('../lib');
|
||||
|
||||
describe('getSpotifyPlaylist', function(){
|
||||
|
||||
it('acquire and parse playlist from Spotify', async function(){
|
||||
const playlist = await getSpotifyPlaylist('https://open.spotify.com/playlist/27OFA3NDwoLWtmdMvowA3S');
|
||||
assert.strictEqual(playlist.name, 'The Best Yoga & Cool-Down Songs');
|
||||
assert.strictEqual(playlist.type, 'playlist');
|
||||
assert.strictEqual(playlist.tracks.items.length, 10);
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user