mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-07 12:30:06 +00:00
test(get-token): covered getTokenRequestErrorPrefix
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { AuthConfig } from '@sasjs/utils'
|
||||
import { AuthConfig, ServerType } from '@sasjs/utils'
|
||||
import * as NodeFormData from 'form-data'
|
||||
import { generateToken, mockAuthResponse } from './mockResponses'
|
||||
import { RequestClient } from '../../request/RequestClient'
|
||||
import { refreshTokensForViya } from '../refreshTokensForViya'
|
||||
import * as IsNodeModule from '../../utils/isNode'
|
||||
import { getTokenRequestErrorPrefixResponse } from '../getTokenRequestErrorPrefix'
|
||||
|
||||
const requestClient = new (<jest.Mock<RequestClient>>RequestClient)()
|
||||
|
||||
@@ -67,9 +68,11 @@ describe('refreshTokensForViya', () => {
|
||||
authConfig.client,
|
||||
authConfig.secret,
|
||||
authConfig.refresh_token
|
||||
).catch((e: any) => e)
|
||||
).catch((e: any) =>
|
||||
getTokenRequestErrorPrefixResponse(e, ServerType.SasViya)
|
||||
)
|
||||
|
||||
expect(error).toEqual(`Error while refreshing tokens: ${tokenError}`)
|
||||
expect(error).toEqual(tokenError)
|
||||
})
|
||||
|
||||
it('should throw an error if environment is not Node', async () => {
|
||||
|
||||
Reference in New Issue
Block a user