@@ -310,27 +310,22 @@ describe('SsoAccessTokenProvider', function () {
310310 } )
311311
312312 it ( 'respects the device authorization expiration time' , async function ( ) {
313- // XXX: Don't know how to fix this "unhandled rejection" caused by this test:
314- // rejected promise not handled within 1 second: Error: Timed-out waiting for browser login flow to complete
315- // at poll (…/src/auth/sso/ssoAccessTokenProvider.ts:251:15)
316- // at async SsoAccessTokenProvider.authorize (…/src/auth/sso/ssoAccessTokenProvider.ts:188:23)
317- // at async SsoAccessTokenProvider.runFlow (…/src/auth/sso/ssoAccessTokenProvider.ts:113:20)
318- // at async SsoAccessTokenProvider.createToken (…/src/auth/sso/ssoAccessTokenProvider.ts:102:24)
319-
320313 setupFlow ( )
321314 stubOpen ( )
322315 const exception = new AuthorizationPendingException ( { message : '' , $metadata : { } } )
323316 const authorization = createAuthorization ( 1000 )
324317 oidcClient . createToken . rejects ( exception )
325318 oidcClient . startDeviceAuthorization . resolves ( authorization )
326319
327- const resp = sut . createToken ( )
320+ sut . createToken ( )
321+ . then ( ( ) => assert . fail ( 'Should not resolve' ) )
322+ . catch ( ( e ) => assert . ok ( e instanceof ToolkitError ) )
323+
328324 const progress = await getTestWindow ( ) . waitForMessage ( / l o g i n p a g e o p e n e d / i)
329325 await clock . tickAsync ( 750 )
330326 assert . ok ( progress . visible )
331327 await clock . tickAsync ( 750 )
332328 assert . ok ( ! progress . visible )
333- await assert . rejects ( resp , ToolkitError )
334329 assertTelemetry ( 'aws_loginWithBrowser' , {
335330 result : 'Failed' ,
336331 isReAuth : undefined ,
0 commit comments