File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ suite("cloud/auth", () => {
271271 await provider . dispose ( )
272272 } )
273273
274- test ( "handles missing session gracefully" , async ( ) => {
274+ test ( "handles file not found gracefully" , async ( ) => {
275275 fsStub . fake . readFile . rejects ( new Error ( "File not found" ) )
276276
277277 const { provider } = createProvider ( )
@@ -545,15 +545,22 @@ suite("cloud/auth", () => {
545545
546546 suite ( "dispose" , ( ) => {
547547 test ( "clears polling interval" , async ( ) => {
548+ const clock = sinon . useFakeTimers ( { shouldAdvanceTime : true } )
548549 const { provider } = createProvider ( )
550+
551+ fsStub . fake . readFile . rejects ( new Error ( "File not found" ) )
552+
549553 provider . startWatching ( )
550- await provider . dispose ( )
551- await provider . dispose ( )
552- } )
553554
554- test ( "disposes without startWatching" , async ( ) => {
555- const { provider } = createProvider ( )
555+ await clock . tickAsync ( 3100 )
556+ const callCount = fsStub . fake . readFile . callCount
557+
556558 await provider . dispose ( )
559+
560+ await clock . tickAsync ( 6000 )
561+ assert . strictEqual ( fsStub . fake . readFile . callCount , callCount )
562+
563+ clock . restore ( )
557564 } )
558565 } )
559566 } )
You can’t perform that action at this time.
0 commit comments