Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should throw invalid client credentials error', async () => {
const _apiConfig = {
...apiConfig,
credentials: {
clientId: 'invalidClientId',
clientSecret: 'invalidClientSecret',
},
}
const _authClient = new SdkAuth(_apiConfig)
try {
await _authClient.clientCredentialsFlow()
throw new Error('Should throw an error')
} catch (err) {
expect(err).toEqual({
code: 401,
statusCode: 401,
status: 401,
message:
'Please provide valid client credentials using HTTP Basic Authentication.',
errors: [
{
code: 'invalid_client',
message:
'Please provide valid client credentials using HTTP Basic Authentication.',
beforeEach(() => {
authClient = new SdkAuth(apiConfig)
})