feat(catalog): allow using different branches

This commit is contained in:
Ivan Shmidt
2020-07-10 09:29:26 +02:00
parent e25ac814ac
commit ab69c9e47b
2 changed files with 0 additions and 17 deletions
@@ -30,20 +30,6 @@ describe('ComponentIdValidators', () => {
expect(ComponentIdValidators.httpsValidator(arg)).toBe(expected);
});
});
describe('masterValidator', () => {
const errorMessage = 'Must reference a file on the master branch.';
test.each([
[true, '/blob/master/'],
[true, 'http://example.com/blob/master/'],
[errorMessage, 'blob/master/'],
[errorMessage, '/blob/master'],
[errorMessage, '/master/'],
[errorMessage, ''],
[errorMessage, undefined],
])('should return %p for %s', (expected: string | boolean, arg: any) => {
expect(ComponentIdValidators.masterValidator(arg)).toBe(expected);
});
});
describe('yamlValidator', () => {
const errorMessage = "Must end with '.yaml'.";
test.each([
@@ -18,9 +18,6 @@ export const ComponentIdValidators = {
httpsValidator: (value: any) =>
(typeof value === 'string' && value.match(/^https:\/\//) !== null) ||
'Must start with https://.',
masterValidator: (value: any) =>
(typeof value === 'string' && value.match(/\/blob\/master\//) !== null) ||
'Must reference a file on the master branch.',
yamlValidator: (value: any) =>
(typeof value === 'string' && value.match(/.yaml$/) !== null) ||
"Must end with '.yaml'.",