-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitFactory.test.ts
25 lines (23 loc) · 867 Bytes
/
gitFactory.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import GitFactory = require('../src/gitFactory');
import GitLabService = require('../src/gitlab/gitlabService');
import Config = require('../src/interfaces/config');
describe('GitFactory', () => {
describe('Create gitService using service name in config', () => {
test('When service name is empty, then should throw error that is is not a supported git service', () => {
const config: Config = {
service: '',
serviceUrl: '',
sections: [],
};
expect(() => new GitFactory(config).create()).toThrow('unsupported git service');
});
test('When service is gitlab, then should create gitlabService', () => {
const config: Config = {
service: 'gitlab',
serviceUrl: '',
sections: [],
};
expect(new GitFactory(config).create()).toBeInstanceOf(GitLabService);
});
});
});