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

32 lines
870 B
TypeScript
Raw Normal View History

2020-03-05 20:57:24 +00:00
import { mock } from 'jest-mock-extended';
import { RenovateConfig, getConfig, mocked } from '../../../test/util';
import { GlobalConfig } from '../../config/global';
2020-03-05 20:57:24 +00:00
import * as _process from './process';
import type { 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');
describe('workers/repository/index', () => {
2020-03-05 20:57:24 +00:00
describe('renovateRepository()', () => {
let config: RenovateConfig;
2020-03-05 20:57:24 +00:00
beforeEach(() => {
config = getConfig();
GlobalConfig.set({ localDir: '' });
2020-03-05 20:57:24 +00:00
});
2020-03-05 20:57:24 +00:00
it('runs', async () => {
process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
2020-03-05 20:57:24 +00:00
const res = await renovateRepository(config);
expect(res).toBeUndefined();
2020-03-05 20:57:24 +00:00
});
});
});