mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 01:14:36 +00:00
test: updated RequestClient specs
This commit is contained in:
@@ -30,6 +30,11 @@ const ERROR_MESSAGES = {
|
||||
CCA: 'unable to verify the first certificate'
|
||||
}
|
||||
|
||||
const incorrectAuthCodeErr = {
|
||||
error: 'unauthorized',
|
||||
error_description: 'Bad credentials'
|
||||
}
|
||||
|
||||
describe('RequestClient', () => {
|
||||
let server: http.Server
|
||||
|
||||
@@ -65,7 +70,7 @@ describe('RequestClient', () => {
|
||||
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
|
||||
).rejects.toEqual(
|
||||
prefixMessage(
|
||||
new LoginRequiredError(),
|
||||
new LoginRequiredError(incorrectAuthCodeErr),
|
||||
'Error while getting access token. '
|
||||
)
|
||||
)
|
||||
@@ -246,7 +251,7 @@ describe('RequestClient - Self Signed Server', () => {
|
||||
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
|
||||
).rejects.toEqual(
|
||||
prefixMessage(
|
||||
new LoginRequiredError(),
|
||||
new LoginRequiredError(incorrectAuthCodeErr),
|
||||
'Error while getting access token. '
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user