mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-30 09:55:18 +00:00
feat: add is_live and is_upcoming to VideoDetails (#271)
* feat: add is_live and is_upcoming to VideoDetails * chore: add tests
This commit is contained in:
@@ -14,6 +14,14 @@ export const VIDEOS = [
|
||||
{
|
||||
ID: 'OqiXFXlYFi8',
|
||||
QUERY: 'formatted comment text'
|
||||
},
|
||||
{
|
||||
ID: 'O3cCYok_ukk',
|
||||
QUERY: 'upcoming video'
|
||||
},
|
||||
{
|
||||
ID: 'jfKfPfyJRdk',
|
||||
QUERY: 'live video'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -44,6 +44,16 @@ describe('YouTube.js Tests', () => {
|
||||
const b_info = await yt.getBasicInfo(VIDEOS[0].ID);
|
||||
expect(b_info.basic_info.id).toBe(VIDEOS[0].ID);
|
||||
});
|
||||
|
||||
it('should be upcoming', async () => {
|
||||
const b_info = await yt.getBasicInfo(VIDEOS[4].ID);
|
||||
expect(b_info.basic_info.is_upcoming).toBe(true);
|
||||
});
|
||||
|
||||
it('should be live', async () => {
|
||||
const b_info = await yt.getBasicInfo(VIDEOS[5].ID);
|
||||
expect(b_info.basic_info.is_live).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Search', () => {
|
||||
|
||||
Reference in New Issue
Block a user