File tree Expand file tree Collapse file tree
packages/devtools/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,8 +380,8 @@ describe('initPangularHub one-time code', () => {
380380 } ) ;
381381
382382 it ( 'stops trusting a connected client when its token expires' , async ( ) => {
383- // The token has under two seconds left when the server starts .
384- const issuedAt = Date . now ( ) - AUTH_TOKEN_TTL_MS + 1500 ;
383+ // The token has four seconds left, room for the hub to start and the client to be trusted .
384+ const issuedAt = Date . now ( ) - AUTH_TOKEN_TTL_MS + 4000 ;
385385 const { connect } = await serve ( ( home ) => {
386386 const dir = authStoreDir ( process . cwd ( ) , home ) ;
387387 mkdirSync ( dir , { recursive : true } ) ;
@@ -394,10 +394,10 @@ describe('initPangularHub one-time code', () => {
394394 } ) ;
395395 const client = await connect ( 'expiring-token' ) ;
396396 expect ( await client . ensureTrusted ( 1000 ) ) . toBe ( true ) ;
397- await vi . waitFor ( ( ) => expect ( client . isTrusted ) . toBe ( false ) , { timeout : 4000 } ) ;
397+ await vi . waitFor ( ( ) => expect ( client . isTrusted ) . toBe ( false ) , { timeout : 6000 } ) ;
398398 const again = await connect ( 'expiring-token' ) ;
399399 expect ( await again . ensureTrusted ( 500 ) . catch ( ( ) => false ) ) . toBe ( false ) ;
400- } ) ;
400+ } , 15_000 ) ;
401401
402402 it ( 'drops expired tokens at startup and keeps the rewritten file private' , async ( ) => {
403403 const old = Date . now ( ) - AUTH_TOKEN_TTL_MS - 1000 ;
You can’t perform that action at this time.
0 commit comments