Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Feb 13, 2023
1 parent c2c35d9 commit a5af9b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/workers/repository/update/pr/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('workers/repository/update/pr/index', () => {
title: prTitle,
bodyStruct,
state: 'open',
displayNumber: '123',
displayNumber: `Pull Request #${number}`,
};

const config: BranchConfig = {
Expand Down Expand Up @@ -767,7 +767,7 @@ describe('workers/repository/update/pr/index', () => {
pr: existingPr,
});
expect(logger.logger.debug).toHaveBeenCalledWith(
'123 does not need updating'
'Pull Request #123 does not need updating'
);
expect(prCache.setPrCache).toHaveBeenCalledTimes(1);
});
Expand All @@ -785,7 +785,7 @@ describe('workers/repository/update/pr/index', () => {
pr: existingPr,
});
expect(logger.logger.debug).toHaveBeenCalledWith(
'123 does not need updating'
'Pull Request #123 does not need updating'
);
expect(logger.logger.debug).toHaveBeenCalledWith(
'PR cache matches but it has been edited in the past 24hrs, so processing PR'
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/repository/update/pr/pr-cache.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('workers/repository/update/pr/pr-cache', () => {
expect(getPrCache('branch_name')).toBeNull();
});

it('return null if prCache is falsy', () => {
it('return null if prCache is null/undefined', () => {
cache.getCache.mockReturnValue(dummyCache);
expect(getPrCache('branch_name')).toBeNull();
});
Expand Down
6 changes: 3 additions & 3 deletions lib/workers/repository/update/pr/pr-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function getPrCache(branchName: string): PrCache | null {
(branch) => branchName === branch.branchName
);

if (branch?.prCache) {
return branch.prCache;
if (!branch?.prCache) {
return null;
}

return null;
return branch.prCache;
}

// store the time a PR was last updated
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/repository/update/pr/pr-fingerprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getElapsedHours } from '../../../../util/date';
import type { BranchConfig } from '../../../types';

// BranchUpgradeConfig - filtered
interface FilteredBranchUpgradeConfig {
export interface FilteredBranchUpgradeConfig {
depName?: string;
gitRef?: boolean;
hasReleaseNotes?: boolean;
Expand Down

0 comments on commit a5af9b1

Please sign in to comment.