mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
243728f263
This reverts commit d1d7901a0a
.
29 lines
908 B
TypeScript
29 lines
908 B
TypeScript
import { RenovateConfig, getConfig, git } from '../../../../test/util';
|
|
import { detectSemanticCommits } from './semantic';
|
|
|
|
jest.mock('../../../util/git');
|
|
|
|
let config: RenovateConfig;
|
|
beforeEach(() => {
|
|
jest.resetAllMocks();
|
|
config = getConfig();
|
|
config.errors = [];
|
|
config.warnings = [];
|
|
});
|
|
|
|
describe('workers/repository/init/semantic', () => {
|
|
describe('detectSemanticCommits()', () => {
|
|
it('detects false if unknown', async () => {
|
|
config.semanticCommits = null;
|
|
git.getCommitMessages.mockResolvedValue(['foo', 'bar']);
|
|
const res = await detectSemanticCommits();
|
|
expect(res).toBe('disabled');
|
|
});
|
|
it('detects true if known', async () => {
|
|
config.semanticCommits = null;
|
|
git.getCommitMessages.mockResolvedValue(['fix: foo', 'refactor: bar']);
|
|
const res = await detectSemanticCommits();
|
|
expect(res).toBe('enabled');
|
|
});
|
|
});
|
|
});
|