renovate/lib/workers/repository/index.spec.ts

28 lines
757 B
TypeScript
Raw Normal View History

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';
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 () => {
process.processRepo.mockResolvedValue(mock<ExtractResult>());
2020-03-05 20:57:24 +00:00
const res = await renovateRepository(config);
expect(res).toMatchSnapshot();
});
});
});