diff --git a/src/infrastructure/BaseService.js b/src/infrastructure/BaseService.js index d418d247c..536ea2cba 100644 --- a/src/infrastructure/BaseService.js +++ b/src/infrastructure/BaseService.js @@ -21,8 +21,6 @@ class BaseModel { this.headers.authorization = `Bearer ${oauthToken}`; } else if (token) { this.headers['private-token'] = token; - } else { - throw new Error('`token` (private-token) or `oauth_token` is mandatory'); } } } diff --git a/test/tests/infrastructure/BaseService.js b/test/tests/infrastructure/BaseService.js index bc2cc6750..09cef8ff0 100644 --- a/test/tests/infrastructure/BaseService.js +++ b/test/tests/infrastructure/BaseService.js @@ -1,12 +1,6 @@ import { BaseService } from '../../../src/infrastructure'; describe('Creation of BaseService instance', () => { - test('If a token or oauthToken is not passed, throw an error', async () => { - expect(() => { - const service = new BaseService(); // eslint-disable-line no-unused-vars - }).toThrowError('`token` (private-token) or `oauth_token` is mandatory'); - }); - test('Url defaults to https://gitlab.com/api/v4', async () => { const service = new BaseService({ token: 'test' });