@@ -7,7 +7,7 @@ describe('PromiseBuffer', () => {
77 const buffer = makePromiseBuffer ( ) ;
88 const p = jest . fn ( ( ) => new SyncPromise ( resolve => setTimeout ( resolve ) ) ) ;
99 void buffer . add ( p ) ;
10- expect ( buffer . length ( ) ) . toEqual ( 1 ) ;
10+ expect ( buffer . $ . length ) . toEqual ( 1 ) ;
1111 } ) ;
1212
1313 test ( 'with limit' , ( ) => {
@@ -20,7 +20,7 @@ describe('PromiseBuffer', () => {
2020 const producer2 = jest . fn ( ( ) => new SyncPromise ( resolve => setTimeout ( resolve ) ) ) ;
2121 expect ( buffer . add ( producer1 ) ) . toEqual ( task1 ) ;
2222 void expect ( buffer . add ( producer2 ) ) . rejects . toThrowError ( ) ;
23- expect ( buffer . length ( ) ) . toEqual ( 1 ) ;
23+ expect ( buffer . $ . length ) . toEqual ( 1 ) ;
2424 expect ( producer1 ) . toHaveBeenCalled ( ) ;
2525 expect ( producer2 ) . not . toHaveBeenCalled ( ) ;
2626 } ) ;
@@ -32,51 +32,51 @@ describe('PromiseBuffer', () => {
3232 for ( let i = 0 ; i < 5 ; i ++ ) {
3333 void buffer . add ( ( ) => new SyncPromise ( resolve => setTimeout ( resolve ) ) ) ;
3434 }
35- expect ( buffer . length ( ) ) . toEqual ( 5 ) ;
35+ expect ( buffer . $ . length ) . toEqual ( 5 ) ;
3636 const result = await buffer . drain ( ) ;
3737 expect ( result ) . toEqual ( true ) ;
38- expect ( buffer . length ( ) ) . toEqual ( 0 ) ;
38+ expect ( buffer . $ . length ) . toEqual ( 0 ) ;
3939 } ) ;
4040
4141 test ( 'with timeout' , async ( ) => {
4242 const buffer = makePromiseBuffer ( ) ;
4343 for ( let i = 0 ; i < 5 ; i ++ ) {
4444 void buffer . add ( ( ) => new SyncPromise ( resolve => setTimeout ( resolve , 100 ) ) ) ;
4545 }
46- expect ( buffer . length ( ) ) . toEqual ( 5 ) ;
46+ expect ( buffer . $ . length ) . toEqual ( 5 ) ;
4747 const result = await buffer . drain ( 50 ) ;
4848 expect ( result ) . toEqual ( false ) ;
4949 } ) ;
5050
5151 test ( 'on empty buffer' , async ( ) => {
5252 const buffer = makePromiseBuffer ( ) ;
53- expect ( buffer . length ( ) ) . toEqual ( 0 ) ;
53+ expect ( buffer . $ . length ) . toEqual ( 0 ) ;
5454 const result = await buffer . drain ( ) ;
5555 expect ( result ) . toEqual ( true ) ;
56- expect ( buffer . length ( ) ) . toEqual ( 0 ) ;
56+ expect ( buffer . $ . length ) . toEqual ( 0 ) ;
5757 } ) ;
5858 } ) ;
5959
6060 test ( 'resolved promises should not show up in buffer length' , async ( ) => {
6161 const buffer = makePromiseBuffer ( ) ;
6262 const producer = ( ) => new SyncPromise ( resolve => setTimeout ( resolve ) ) ;
6363 const task = buffer . add ( producer ) ;
64- expect ( buffer . length ( ) ) . toEqual ( 1 ) ;
64+ expect ( buffer . $ . length ) . toEqual ( 1 ) ;
6565 await task ;
66- expect ( buffer . length ( ) ) . toEqual ( 0 ) ;
66+ expect ( buffer . $ . length ) . toEqual ( 0 ) ;
6767 } ) ;
6868
6969 test ( 'rejected promises should not show up in buffer length' , async ( ) => {
7070 const buffer = makePromiseBuffer ( ) ;
7171 const producer = ( ) => new SyncPromise ( ( _ , reject ) => setTimeout ( reject ) ) ;
7272 const task = buffer . add ( producer ) ;
73- expect ( buffer . length ( ) ) . toEqual ( 1 ) ;
73+ expect ( buffer . $ . length ) . toEqual ( 1 ) ;
7474 try {
7575 await task ;
7676 } catch ( _ ) {
7777 // no-empty
7878 }
79- expect ( buffer . length ( ) ) . toEqual ( 0 ) ;
79+ expect ( buffer . $ . length ) . toEqual ( 0 ) ;
8080 } ) ;
8181
8282 test ( 'resolved task should give an access to the return value' , async ( ) => {
0 commit comments