@@ -310,29 +310,27 @@ 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+
313320 setupFlow ( )
314321 stubOpen ( )
315322 const exception = new AuthorizationPendingException ( { message : '' , $metadata : { } } )
316323 const authorization = createAuthorization ( 1000 )
317324 oidcClient . createToken . rejects ( exception )
318325 oidcClient . startDeviceAuthorization . resolves ( authorization )
319326
320- const resp = sut
321- . createToken ( )
322- . then ( ( ) => assert . fail ( 'Should not resolve' ) )
323- . catch ( ( e ) => {
324- assert . ok (
325- e instanceof ToolkitError &&
326- e . message === 'Timed-out waiting for browser login flow to complete'
327- )
328- } )
329-
327+ const resp = sut . createToken ( )
330328 const progress = await getTestWindow ( ) . waitForMessage ( / l o g i n p a g e o p e n e d / i)
331329 await clock . tickAsync ( 750 )
332330 assert . ok ( progress . visible )
333331 await clock . tickAsync ( 750 )
334332 assert . ok ( ! progress . visible )
335- await resp
333+ await assert . rejects ( resp , ToolkitError )
336334 assertTelemetry ( 'aws_loginWithBrowser' , {
337335 result : 'Failed' ,
338336 isReAuth : undefined ,
0 commit comments