fix youtube

This commit is contained in:
Sayem Chowdhury 2021-03-28 02:16:02 +06:00
parent d18996ca2b
commit 4ce3f285f5
2 changed files with 13 additions and 1 deletions

View File

@ -124,6 +124,18 @@ test('PARSE TIDAL ARTIST', async (t) => {
t.true(response.tracks.length > 5); t.true(response.tracks.length > 5);
}); });
if (!process.env.CI) {
test('PARSE YOUTUBE TRACK', async (t) => {
const url = 'https://www.youtube.com/watch?v=4NRXx6U8ABQ';
const response = await parseInfo(url);
t.deepEqual(response.info, {id: '4NRXx6U8ABQ', type: 'youtube-track'});
t.deepEqual(response.linkinfo, {});
t.is(response.linktype, 'track');
t.is(response.tracks.length, 1);
});
}
// Fail Tests // Fail Tests
test('SHOULD FAIL STRING', async (t) => { test('SHOULD FAIL STRING', async (t) => {
const str = 'hello there'; const str = 'hello there';

View File

@ -10,7 +10,7 @@ import {
import spotifyUri from 'spotify-uri'; import spotifyUri from 'spotify-uri';
import * as spotify from './spotify'; import * as spotify from './spotify';
import * as tidal from './tidal'; import * as tidal from './tidal';
import * as youtube from './tidal'; import * as youtube from './youtube';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import type {albumType, artistInfoType, playlistInfo, trackType} from '../types'; import type {albumType, artistInfoType, playlistInfo, trackType} from '../types';