Bring test I accidently deleted

This commit is contained in:
Josh Dales
2023-05-17 07:26:44 -04:00
parent 57d34076e0
commit 3352df1f2b

View File

@@ -168,6 +168,20 @@ describe('run', () => {
});
});
it('can support multiple branches by providing an array', async () => {
github.context.payload.pull_request!.head = {ref: 'array/123'};
usingLabelerConfigYaml('branches.yml');
await run();
expect(addLabelsMock).toHaveBeenCalledTimes(1);
expect(addLabelsMock).toHaveBeenCalledWith({
owner: 'monalisa',
repo: 'helloworld',
issue_number: 123,
labels: ['array-branch']
});
});
it('adds a label when matching any and all patterns are provided', async () => {
usingLabelerConfigYaml('any_and_all.yml');
mockGitHubResponseChangedFiles('tests/test.ts');