Skip to content
Snippets Groups Projects
Commit e6c524fc authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor: processRepo -> extractDependencies

parent fbac60c2
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ describe('workers/repository', () => {
config = getConfig();
});
it('runs', async () => {
process.processRepo.mockResolvedValue(mock<ExtractResult>());
process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
const res = await renovateRepository(config);
expect(res).toMatchSnapshot();
});
......
......@@ -8,7 +8,7 @@ import { finaliseRepo } from './finalise';
import { initRepo } from './init';
import { ensureMasterIssue } from './master-issue';
import { ensureOnboardingPr } from './onboarding/pr';
import { processRepo, updateRepo } from './process';
import { extractDependencies, updateRepo } from './process';
import { ProcessResult, processResult } from './result';
let renovateVersion = 'unknown';
......@@ -32,7 +32,9 @@ export async function renovateRepository(
await fs.ensureDir(config.localDir);
logger.debug('Using localDir: ' + config.localDir);
config = await initRepo(config);
const { branches, branchList, packageFiles } = await processRepo(config);
const { branches, branchList, packageFiles } = await extractDependencies(
config
);
await ensureOnboardingPr(config, packageFiles, branches);
const res = await updateRepo(config, branches, branchList);
if (res !== 'automerged') {
......
import { RenovateConfig, getConfig, mocked } from '../../../../test/util';
import * as _extractUpdate from './extract-update';
import { processRepo, updateRepo } from './index';
import { extractDependencies, updateRepo } from './index';
jest.mock('./extract-update');
......@@ -15,13 +15,13 @@ beforeEach(() => {
describe('workers/repository/process/index', () => {
describe('processRepo()', () => {
it('processes single branches', async () => {
const res = await processRepo(config);
const res = await extractDependencies(config);
expect(res).toMatchSnapshot();
});
it('processes baseBranches', async () => {
extract.mockResolvedValue({} as never);
config.baseBranches = ['branch1', 'branch2'];
const res = await processRepo(config);
const res = await extractDependencies(config);
await updateRepo(config, res.branches, res.branchList);
expect(res).toMatchSnapshot();
});
......
......@@ -6,7 +6,7 @@ import { BranchConfig } from '../../common';
import { ExtractResult, extract, update } from './extract-update';
import { WriteUpdateResult } from './write';
export async function processRepo(
export async function extractDependencies(
config: RenovateConfig
): Promise<ExtractResult> {
logger.debug('processRepo()');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment