test track and album

This commit is contained in:
Sayem Chowdhury 2021-03-24 00:45:45 +06:00
parent aac41299fb
commit e36b94a18c
1 changed files with 20 additions and 0 deletions

View File

@ -1,6 +1,8 @@
import test from 'ava'; import test from 'ava';
import {spotify} from '../../src'; import {spotify} from '../../src';
const SNG_ID = '7FIWs0pqAYbP91WWM0vlTQ';
const ALB_ID = '6t7956yu5zYf5A829XRiHC';
const PLAYLIST_TITLE = 'This Is Eminem'; const PLAYLIST_TITLE = 'This Is Eminem';
const PLAYLIST_ID = '37i9dQZF1DX1clOuib1KtQ'; const PLAYLIST_ID = '37i9dQZF1DX1clOuib1KtQ';
const ARTIST_ID = '7dGJo4pcD2V6oG8kP0tJRR'; const ARTIST_ID = '7dGJo4pcD2V6oG8kP0tJRR';
@ -12,6 +14,24 @@ test.serial('SET ANONYMOUS TOKEN', async (t) => {
t.true(response.isAnonymous); t.true(response.isAnonymous);
}); });
test('GET TRACK INFO', async (t) => {
const track = await spotify.track2deezer(SNG_ID);
t.is(track.SNG_ID, '854914322');
t.is(track.ISRC, 'USUM72000788');
t.is(track.MD5_ORIGIN, '6f542518431052368a1c48d14c10d37e');
t.is(track.__TYPE__, 'song');
});
test('GET ALBUM INFO', async (t) => {
const [album, tracks] = await spotify.album2deezer(ALB_ID);
t.is(album.ALB_ID, '125748');
t.is(album.UPC, '606949062927');
t.is(album.__TYPE__, 'album');
t.is(tracks.length, 18);
});
test('GET ARTIST TO DEEZER TRACKS', async (t) => { test('GET ARTIST TO DEEZER TRACKS', async (t) => {
const tracks = await spotify.artist2Deezer(ARTIST_ID); const tracks = await spotify.artist2Deezer(ARTIST_ID);