Add test
Add a test to test the scenario that the previous commit fixes. If a repo has a malformed CODEOWNERS file that contains just a pattern and no names the match object will have an empty `owners` array, in which case resolveCodeOwner should return undefined. Signed-off-by: Isabel Tomb <isabelgtomb@gmail.com>
This commit is contained in:
@@ -46,6 +46,14 @@ describe('resolveCodeOwner', () => {
|
||||
),
|
||||
).toBe('team-foo');
|
||||
});
|
||||
it('should return undefined if the codeowners file contains no names', () => {
|
||||
expect(
|
||||
resolveCodeOwner(
|
||||
`*`,
|
||||
'https://github.com/acme/repo/tree/docs/catalog-info.yaml',
|
||||
),
|
||||
).toBe(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('normalizeCodeOwner', () => {
|
||||
|
||||
Reference in New Issue
Block a user