2020-03-05 20:57:24 +00:00
|
|
|
import { mock } from 'jest-mock-extended';
|
|
|
|
|
2021-08-18 05:46:56 +00:00
|
|
|
import { RenovateConfig, getConfig, mocked } from '../../../test/util';
|
2021-11-23 20:10:45 +00:00
|
|
|
import { GlobalConfig } from '../../config/global';
|
2020-03-05 20:57:24 +00:00
|
|
|
import * as _process from './process';
|
2020-04-18 13:36:38 +00:00
|
|
|
import { ExtractResult } from './process/extract-update';
|
2020-05-01 16:03:48 +00:00
|
|
|
import { renovateRepository } from '.';
|
2020-03-05 20:57:24 +00:00
|
|
|
|
|
|
|
const process = mocked(_process);
|
|
|
|
|
|
|
|
jest.mock('./init');
|
|
|
|
jest.mock('./process');
|
|
|
|
jest.mock('./result');
|
|
|
|
jest.mock('./error');
|
|
|
|
|
2021-08-18 05:46:56 +00:00
|
|
|
describe('workers/repository/index', () => {
|
2020-03-05 20:57:24 +00:00
|
|
|
describe('renovateRepository()', () => {
|
|
|
|
let config: RenovateConfig;
|
|
|
|
beforeEach(() => {
|
|
|
|
config = getConfig();
|
2021-11-23 20:10:45 +00:00
|
|
|
GlobalConfig.set({ localDir: '' });
|
2020-03-05 20:57:24 +00:00
|
|
|
});
|
|
|
|
it('runs', async () => {
|
2020-05-08 06:53:39 +00:00
|
|
|
process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
|
2020-03-05 20:57:24 +00:00
|
|
|
const res = await renovateRepository(config);
|
2021-11-07 15:34:42 +00:00
|
|
|
expect(res).toBeUndefined();
|
2020-03-05 20:57:24 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|