Skip to content

Commit

Permalink
refactor(onboarding): rename function (#32059)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh authored Oct 21, 2024
1 parent 4054ca9 commit d5caadf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/workers/repository/onboarding/pr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from '../common';
import { getBaseBranchDesc } from './base-branch';
import { getConfigDesc } from './config-description';
import { getPrList } from './pr-list';
import { getExpectedPrList } from './pr-list';

export async function ensureOnboardingPr(
config: RenovateConfig,
Expand Down Expand Up @@ -135,7 +135,7 @@ If you need any further assistance then you can also [request help here](${
);
prBody = prBody.replace('{{ERRORS}}\n', getErrors(config));
prBody = prBody.replace('{{BASEBRANCH}}\n', getBaseBranchDesc(config));
prBody = prBody.replace('{{PRLIST}}\n', getPrList(config, branches));
prBody = prBody.replace('{{PRLIST}}\n', getExpectedPrList(config, branches));
if (is.string(config.prHeader)) {
prBody = `${template.compile(config.prHeader, config)}\n\n${prBody}`;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/workers/repository/onboarding/pr/pr-list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { RenovateConfig } from '../../../../../test/util';
import { partial } from '../../../../../test/util';
import type { BranchConfig } from '../../../types';
import { getPrList } from './pr-list';
import { getExpectedPrList } from './pr-list';

describe('workers/repository/onboarding/pr/pr-list', () => {
describe('getPrList()', () => {
describe('getExpectedPrList()', () => {
let config: RenovateConfig;

beforeEach(() => {
Expand All @@ -15,7 +15,7 @@ describe('workers/repository/onboarding/pr/pr-list', () => {

it('handles empty', () => {
const branches: BranchConfig[] = [];
const res = getPrList(config, branches);
const res = getExpectedPrList(config, branches);
expect(res).toMatchInlineSnapshot(`
"
### What to Expect
Expand All @@ -42,7 +42,7 @@ describe('workers/repository/onboarding/pr/pr-list', () => {
],
},
];
const res = getPrList(config, branches);
const res = getExpectedPrList(config, branches);
expect(res).toMatchInlineSnapshot(`
"
### What to Expect
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('workers/repository/onboarding/pr/pr-list', () => {
},
];
config.prHourlyLimit = 1;
const res = getPrList(config, branches);
const res = getExpectedPrList(config, branches);
expect(res).toMatchInlineSnapshot(`
"
### What to Expect
Expand Down
4 changes: 2 additions & 2 deletions lib/workers/repository/onboarding/pr/pr-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { emojify } from '../../../../util/emoji';
import { regEx } from '../../../../util/regex';
import type { BranchConfig } from '../../../types';

export function getPrList(
export function getExpectedPrList(
config: RenovateConfig,
branches: BranchConfig[],
): string {
logger.debug('getPrList()');
logger.debug('getExpectedPrList()');
logger.trace({ config });
let prDesc = `\n### What to Expect\n\n`;
if (!branches.length) {
Expand Down

0 comments on commit d5caadf

Please sign in to comment.