mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-13 23:20:05 +00:00
test(get-token): covered getTokenRequestErrorPrefix
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { ServerType } from '@sasjs/utils'
|
||||
import { generateToken, mockAuthResponse } from './mockResponses'
|
||||
import { RequestClient } from '../../request/RequestClient'
|
||||
import { refreshTokensForSasjs } from '../refreshTokensForSasjs'
|
||||
import { getTokenRequestErrorPrefixResponse } from '../getTokenRequestErrorPrefix'
|
||||
|
||||
const requestClient = new (<jest.Mock<RequestClient>>RequestClient)()
|
||||
|
||||
@@ -38,9 +40,9 @@ describe('refreshTokensForSasjs', () => {
|
||||
const error = await refreshTokensForSasjs(
|
||||
requestClient,
|
||||
refresh_token
|
||||
).catch((e: any) => e)
|
||||
).catch((e: any) => getTokenRequestErrorPrefixResponse(e, ServerType.Sasjs))
|
||||
|
||||
expect(error).toEqual(`Error while refreshing tokens: ${tokenError}`)
|
||||
expect(error).toEqual(tokenError)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user