get channel list
This commit is contained in:
parent
32a3945f61
commit
f3e982c946
|
@ -221,7 +221,15 @@ if (process.env.CI) {
|
|||
});
|
||||
}
|
||||
|
||||
test('GET CHANNEL LIST', async (t) => {
|
||||
const channel = await api.getChannelList();
|
||||
t.is(channel.count, channel.data.length);
|
||||
t.true(Array.isArray(channel.data));
|
||||
});
|
||||
|
||||
test('GET PLAYLIST CHANNEL', async (t) => {
|
||||
const channel = await api.getPlaylistChannel('dance');
|
||||
t.deepEqual(Object.keys(channel), ['version', 'page_id', 'ga', 'title', 'persistent', 'sections', 'expire']);
|
||||
t.truthy(channel.title);
|
||||
t.true(Array.isArray(channel.sections));
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ import type {
|
|||
playlistInfo,
|
||||
playlistTracksType,
|
||||
playlistChannelType,
|
||||
channelSearchType,
|
||||
artistInfoType,
|
||||
discographyType,
|
||||
profileType,
|
||||
|
@ -130,6 +131,11 @@ export const getUser = async (): Promise<userType> => {
|
|||
throw new Error(errorMessage);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get list of channles
|
||||
*/
|
||||
export const getChannelList = async (): Promise<channelSearchType> => request({}, 'search_getChannels');
|
||||
|
||||
/**
|
||||
* Get details about a playlist channel
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,7 @@ export * from './album';
|
|||
export * from './artist';
|
||||
export * from './playlist';
|
||||
export * from './playlist-channel';
|
||||
export * from './channel';
|
||||
export * from './profile';
|
||||
export * from './search';
|
||||
export * from './tracks';
|
||||
|
|
Loading…
Reference in New Issue