@@ -13,7 +13,7 @@ import { getCache } from '../../../auth/sso/cache'
1313import { makeTemporaryToolkitFolder , tryRemoveFolder } from '../../../shared/filesystemUtilities'
1414import { ClientRegistration , SsoProfile , SsoToken , proceedToBrowser } from '../../../auth/sso/model'
1515import { OidcClient } from '../../../auth/sso/clients'
16- import { CancellationError } from '../../../shared/utilities/timeoutUtils'
16+ import { CancellationError , sleep } from '../../../shared/utilities/timeoutUtils'
1717import {
1818 AuthorizationPendingException ,
1919 InternalServerException ,
@@ -81,8 +81,9 @@ describe('SsoAccessTokenProvider', function () {
8181 clock = installFakeClock ( )
8282 } )
8383
84- after ( function ( ) {
84+ after ( async function ( ) {
8585 clock . uninstall ( )
86+ await sleep ( 3000 )
8687 } )
8788
8889 beforeEach ( async function ( ) {
@@ -317,7 +318,8 @@ describe('SsoAccessTokenProvider', function () {
317318 oidcClient . createToken . rejects ( exception )
318319 oidcClient . startDeviceAuthorization . resolves ( authorization )
319320
320- sut . createToken ( )
321+ const resp = sut
322+ . createToken ( )
321323 . then ( ( ) => assert . fail ( 'Should not resolve' ) )
322324 . catch ( ( e ) => assert . ok ( e instanceof ToolkitError ) )
323325
@@ -331,6 +333,7 @@ describe('SsoAccessTokenProvider', function () {
331333 isReAuth : undefined ,
332334 credentialStartUrl : startUrl ,
333335 } )
336+ await resp
334337 } )
335338
336339 /**
0 commit comments