File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,24 @@ describe('Queue', () => {
119
119
expect ( taskSpy . callCount ) . to . eql ( 1 )
120
120
} )
121
121
122
+ it ( 'should not start again until start is called' , async ( ) => {
123
+ const queue = new Queue ( priorities . CRITICAL )
124
+ const taskSpy = spy ( ( ) => { } )
125
+ queue . add ( taskSpy )
126
+ await queue . processing ( )
127
+ expect ( queue . size ) . to . eql ( 0 )
128
+ expect ( taskSpy . callCount ) . to . eql ( 1 )
129
+ queue . stop ( )
130
+ queue . add ( taskSpy )
131
+ await beforeNextFrame ( )
132
+ expect ( queue . size ) . to . eql ( 1 )
133
+ expect ( taskSpy . callCount ) . to . eql ( 1 )
134
+ queue . start ( )
135
+ await beforeNextFrame ( )
136
+ expect ( queue . size ) . to . eql ( 0 )
137
+ expect ( taskSpy . callCount ) . to . eql ( 2 )
138
+ } )
139
+
122
140
it ( 'should have the same effect on multiple calls' , async ( ) => {
123
141
const queue = new Queue ( priorities . CRITICAL )
124
142
const taskSpy = spy ( ( ) => { } )
You can’t perform that action at this time.
0 commit comments