converter test

This commit is contained in:
Sayem Chowdhury 2021-03-23 20:28:42 +06:00
parent 3f0d47e9e4
commit 03983dfcde
1 changed files with 29 additions and 0 deletions

29
src/tests/converter.ts Normal file
View File

@ -0,0 +1,29 @@
import test from 'ava';
import * as api from '../';
// Harder, Better, Faster, Stronger by Daft Punk
const SNG_TITLE = 'Harder, Better, Faster, Stronger';
const ISRC = 'GBDUW0000059';
// Discovery by Daft Punk
const ALB_TITLE = 'Discovery';
const UPC = '724384960650';
test.serial('GET TRACK ISRC', async (t) => {
const response = await api.deezerConverter.isrc2deezer(SNG_TITLE, ISRC);
t.is(response.SNG_TITLE, SNG_TITLE);
t.is(response.ISRC, ISRC);
t.is(response.MD5_ORIGIN, '51afcde9f56a132096c0496cc95eb24b');
t.is(response.__TYPE__, 'song');
});
test.serial('GET ALBUM UPC', async (t) => {
const [album, tracks] = await api.deezerConverter.upc2deezer(ALB_TITLE, UPC);
t.is(album.ALB_TITLE, ALB_TITLE);
t.is(album.UPC, UPC);
t.is(album.__TYPE__, 'album');
t.is(Number(album.NUMBER_TRACK), tracks.length);
});