File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ describe("PrismaQueue", () => {
190190 // Stop the queue that was started in beforeEach
191191 await queue . stop ( ) ;
192192
193- queue . worker = vi . fn ( async ( _job ) => {
193+ queue . worker = vi . fn ( async ( _job : EmailJob ) => {
194194 await waitFor ( JOB_WAIT ) ;
195195 return { code : "200" } ;
196196 } ) ;
@@ -210,7 +210,8 @@ describe("PrismaQueue", () => {
210210 await queue . stop ( ) ;
211211
212212 // May or may not have started processing
213- const countAfterInterruption = queue . worker . mock . calls . length ;
213+ const mockedWorker = queue . worker as ReturnType < typeof vi . fn > ;
214+ const countAfterInterruption = mockedWorker . mock . calls . length ;
214215
215216 // Now properly start and let all jobs complete
216217 void queue . start ( ) ;
@@ -222,7 +223,7 @@ describe("PrismaQueue", () => {
222223 }
223224
224225 // Eventually both jobs should be processed
225- expect ( queue . worker . mock . calls . length ) . toBe ( 2 ) ;
226+ expect ( mockedWorker . mock . calls . length ) . toBe ( 2 ) ;
226227 } , 10000 ) ; // Increase timeout for this test
227228 afterAll ( ( ) => {
228229 void queue . stop ( ) ;
Original file line number Diff line number Diff line change @@ -47,4 +47,4 @@ describe("time utilities", () => {
4747 expect ( isValidTimeZone ( "Pacific/Port_Moresby" ) ) . toBe ( true ) ;
4848 } ) ;
4949 } ) ;
50- } ) ;
50+ } ) ;
You can’t perform that action at this time.
0 commit comments