Skip to content

Commit

Permalink
Add test to fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
anarast committed Jan 18, 2021
1 parent 6aef4e5 commit 1a152b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/autoupdate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ describe('test `prNeedsUpdate`', () => {
expect(scope.isDone()).toEqual(true);
});

test('no excluded labels were configured', async () => {
test('excluded labels were configured but not found', async () => {
(config.pullRequestFilter as jest.Mock).mockReturnValue('all');
(config.excludedLabels as jest.Mock).mockReturnValue([]);
(config.excludedLabels as jest.Mock).mockReturnValue(['label']);

const scope = nock('https://api.github.com:443')
.get(`/repos/${owner}/${repo}/compare/${head}...${base}`)
Expand Down Expand Up @@ -146,6 +146,7 @@ describe('test `prNeedsUpdate`', () => {
expect(needsUpdate).toEqual(false);
expect(scope.isDone()).toEqual(true);
expect(config.excludedLabels).toHaveBeenCalled();

// The excluded labels check happens before we check any filters so these
// functions should never be called.
expect(config.pullRequestFilter).toHaveBeenCalledTimes(0);
Expand Down

0 comments on commit 1a152b3

Please sign in to comment.