11import { createWriteStream , existsSync } from 'node:fs' ;
22import { Innertube , Utils , YT , YTMusic , YTNodes } from '../bundle/node.cjs' ;
33
4+ jest . useRealTimers ( ) ;
5+
46describe ( 'YouTube.js Tests' , ( ) => {
57 let innertube : Innertube ;
68
@@ -99,7 +101,7 @@ describe('YouTube.js Tests', () => {
99101 let comments : YT . Comments ;
100102
101103 beforeAll ( async ( ) => {
102- comments = await innertube . getComments ( 'gmX-ceF-N1k ' ) ;
104+ comments = await innertube . getComments ( 'bUHZ2k9DYHY ' ) ;
103105 expect ( comments ) . toBeDefined ( ) ;
104106 expect ( comments . header ) . toBeDefined ( ) ;
105107 expect ( comments . contents ) . toBeDefined ( ) ;
@@ -112,10 +114,20 @@ describe('YouTube.js Tests', () => {
112114 expect ( incremental_continuation . contents . length ) . toBeGreaterThan ( 0 ) ;
113115 } ) ;
114116
115- test ( 'CommentThread#getReplies' , async ( ) => {
116- let comment_thread = comments . contents . first ( ) ;
117- let loaded_comment_thread = await comment_thread . getReplies ( ) ;
118- expect ( loaded_comment_thread . replies ) . toBeDefined ( ) ;
117+ describe ( 'CommentThread#getReplies' , ( ) => {
118+ let loaded_comment_thread : YTNodes . CommentThread ;
119+
120+ beforeAll ( async ( ) => {
121+ let comment_thread = comments . contents . first ( ) ;
122+ loaded_comment_thread = await comment_thread . getReplies ( ) ;
123+ expect ( loaded_comment_thread . replies ) . toBeDefined ( ) ;
124+ } ) ;
125+
126+ test ( 'CommentThread#getContinuation' , async ( ) => {
127+ const incremental_continuation = await loaded_comment_thread . getContinuation ( ) ;
128+ expect ( incremental_continuation . replies ) . toBeDefined ( ) ;
129+ expect ( incremental_continuation . replies ?. length ) . toBeGreaterThan ( 0 ) ;
130+ } ) ;
119131 } ) ;
120132 } ) ;
121133
0 commit comments