@@ -34,47 +34,47 @@ describe('bind-progress', () => {
3434
3535 test ( 'should debug files on zip/files event' , ( ) => {
3636 process . emit ( 'zip/files' , { foo : 'bar' } )
37- expect ( pgb . debug ) . toBeCalledWith ( { foo : 'bar' } )
37+ expect ( pgb . debug ) . toHaveBeenCalledWith ( { foo : 'bar' } )
3838 } )
3939
4040 test ( 'should stop progress on end events' , ( ) => {
4141 process . emit ( 'api/write' , { size : 2000000 , pos : 25 } )
4242 process . emit ( 'zip/write' , { size : 2000000 , pos : 25 } )
4343 process . emit ( 'api/connect' )
4444 process . emit ( 'zip/end' )
45- expect ( Progress . mock . instances [ 0 ] . stop ) . toBeCalledWith ( )
46- expect ( Progress . mock . instances [ 1 ] . stop ) . toBeCalledWith ( )
45+ expect ( Progress . mock . instances [ 0 ] . stop ) . toHaveBeenCalledWith ( )
46+ expect ( Progress . mock . instances [ 1 ] . stop ) . toHaveBeenCalledWith ( )
4747 } )
4848
4949 test ( 'should instantiate and/or update progress on api/write' , ( ) => {
5050 process . emit ( 'api/write' , { size : 2000000 , pos : 25 } )
5151 process . emit ( 'api/write' , { size : 2000000 , pos : 25 } )
52- expect ( Progress ) . toBeCalledWith ( 'uploading ' , 2000000 , 40 )
53- expect ( Progress . mock . instances [ 0 ] . update ) . toBeCalledWith ( 25 , '25 B / 1.9 MB' )
52+ expect ( Progress ) . toHaveBeenCalledWith ( 'uploading ' , 2000000 , 40 )
53+ expect ( Progress . mock . instances [ 0 ] . update ) . toHaveBeenCalledWith ( 25 , '25 B / 1.9 MB' )
5454 } )
5555
5656 test ( 'should not instantiate and/or update progress on api/write if too small' , ( ) => {
5757 process . emit ( 'api/write' , { size : 100 , pos : 25 } )
58- expect ( Progress ) . not . toBeCalledWith ( )
58+ expect ( Progress ) . not . toHaveBeenCalledWith ( )
5959 } )
6060
6161 test ( 'should instantiate and/or update progress on api/write if too small but has zipper' , ( ) => {
6262 process . emit ( 'zip/write' , { size : 2000000 , pos : 25 } )
63- expect ( Progress . mock . instances [ 0 ] . update ) . toBeCalledWith ( 25 , '25 B / 1.9 MB' )
63+ expect ( Progress . mock . instances [ 0 ] . update ) . toHaveBeenCalledWith ( 25 , '25 B / 1.9 MB' )
6464 process . emit ( 'api/write' , { size : 100 , pos : 22 } )
65- expect ( Progress . mock . instances [ 1 ] . update ) . toBeCalledWith ( 22 , '22 B / 100 B' )
65+ expect ( Progress . mock . instances [ 1 ] . update ) . toHaveBeenCalledWith ( 22 , '22 B / 100 B' )
6666 } )
6767
6868 test ( 'should not instantiate and/or update progress on api/write if noprogress' , ( ) => {
6969 pgb . opts . noprogress = true
7070 process . emit ( 'api/write' , { size : 2000000 , pos : 25 } )
71- expect ( Progress ) . not . toBeCalledWith ( )
71+ expect ( Progress ) . not . toHaveBeenCalledWith ( )
7272 } )
7373
7474 test ( 'should instantiate and/or update progress on zip/write' , ( ) => {
7575 process . emit ( 'zip/write' , { size : 200000 , pos : 25 } )
7676 process . emit ( 'zip/write' , { size : 200000 , pos : 25 } )
77- expect ( Progress ) . toBeCalledWith ( 'archiving ' , 200000 , 40 )
77+ expect ( Progress ) . toHaveBeenCalledWith ( 'archiving ' , 200000 , 40 )
7878 } )
7979
8080 test ( 'should not bind events if noprogress' , ( ) => {
@@ -84,6 +84,6 @@ describe('bind-progress', () => {
8484 bindProgress = BindProgress ( )
8585 process . emit ( 'zip/write' , { size : 2000000 , pos : 25 } )
8686 expect ( process . eventNames ( ) ) . not . toContain ( [ 'zip/files' , 'zip/end' , 'api/connect' , 'zip/write' , 'api/write' ] )
87- expect ( Progress ) . not . toBeCalled ( )
87+ expect ( Progress ) . not . toHaveBeenCalled ( )
8888 } )
8989} )
0 commit comments