renovate/lib/workers/repository/index.spec.ts
2021-08-17 07:57:45 +02:00

30 lines
901 B
TypeScript

import { mock } from 'jest-mock-extended';
import { RenovateConfig, getConfig, getName, mocked } from '../../../test/util';
import { setGlobalConfig } from '../../config/global';
import * as _process from './process';
import { ExtractResult } from './process/extract-update';
import { renovateRepository } from '.';
const process = mocked(_process);
jest.mock('./init');
jest.mock('./process');
jest.mock('./result');
jest.mock('./error');
describe(getName(), () => {
describe('renovateRepository()', () => {
let config: RenovateConfig;
beforeEach(() => {
config = getConfig();
setGlobalConfig({ localDir: '' });
});
it('runs', async () => {
process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
const res = await renovateRepository(config);
// FIXME: explicit assert condition
expect(res).toMatchSnapshot();
});
});
});