feat: add-test and some fixes #1
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",
|
"description": "Download Spotify playlist as mp3 from VKontakte",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "mocha"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"vk-music-dl": "./index.js"
|
"vk-music-dl": "./index.js"
|
||||||
|
@ -36,5 +36,7 @@
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"promisepipe": "^3.0.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