2020-03-05 20:57:24 +00:00
|
|
|
import { mock } from 'jest-mock-extended';
|
|
|
|
|
|
|
|
import { renovateRepository } from '.';
|
|
|
|
import * as _process from './process';
|
|
|
|
import { mocked, RenovateConfig, getConfig } from '../../../test/util';
|
2020-04-18 13:36:38 +00:00
|
|
|
import { ExtractResult } from './process/extract-update';
|
2020-03-05 20:57:24 +00:00
|
|
|
|
|
|
|
const process = mocked(_process);
|
|
|
|
|
|
|
|
jest.mock('./init');
|
|
|
|
jest.mock('./process');
|
|
|
|
jest.mock('./result');
|
|
|
|
jest.mock('./error');
|
|
|
|
|
|
|
|
describe('workers/repository', () => {
|
|
|
|
describe('renovateRepository()', () => {
|
|
|
|
let config: RenovateConfig;
|
|
|
|
beforeEach(() => {
|
|
|
|
config = getConfig();
|
|
|
|
});
|
|
|
|
it('runs', async () => {
|
2020-04-18 13:36:38 +00:00
|
|
|
process.processRepo.mockResolvedValue(mock<ExtractResult>());
|
2020-03-05 20:57:24 +00:00
|
|
|
const res = await renovateRepository(config);
|
|
|
|
expect(res).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|