Skip to content

Commit

Permalink
test: add test for video metadata with id that starts with special ch…
Browse files Browse the repository at this point in the history
…aracter '-'
  • Loading branch information
talmobi committed Aug 20, 2024
1 parent 6a19118 commit bc19fb0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,26 @@ test( 'video metadata by faulty/non-existing id', function ( t ) {
} )
} )

test( 'video metadata by id -ObdvMkCKws (special character "-" at beginning of id)', function ( t ) {
t.plan( 7 )

yts( { videoId: '-ObdvMkCKws' }, function ( err, video ) {
t.error( err, 'no errors OK!' )

const MILLION = 1000 * 1000

t.ok( video.title.indexOf("Top 20 Most Popular Songs by NCS") >= 0, 'title ok' )
t.equal( video.videoId, '-ObdvMkCKws', 'videoId' )

t.equal( video.timestamp, '1:12:47', 'timestamp' )
t.equal( video.seconds, 4367, 'seconds (duration)' )

t.ok( video.description.indexOf( 'Top NCS full' ) >= 0, 'description ok' )

t.ok( video.views > ( 30 * MILLION ), 'views over 30 Million' )
} )
} )

test( 'video metadata by id _JzeIf1zT14', function ( t ) {
t.plan( 13 )

Expand Down

0 comments on commit bc19fb0

Please sign in to comment.