mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-27 05:09:37 +00:00
c2d3ca856f
Changes fetchReleaseNotes from boolean to enum, with values off, branch, pr. Closes #20476 BREAKING CHANGE: Release notes won't be fetched early for commitBody insertion unless explicitly configured with fetchReleaseNotes=branch
30 lines
959 B
TypeScript
30 lines
959 B
TypeScript
import { mockedFunction, partial } from '../../../../test/util';
|
|
import type { BranchUpgradeConfig } from '../../types';
|
|
import { getChangeLogJSON } from '../update/pr/changelog';
|
|
import { embedChangelogs } from '.';
|
|
|
|
jest.mock('../update/pr/changelog');
|
|
|
|
mockedFunction(getChangeLogJSON).mockResolvedValue({
|
|
hasReleaseNotes: true,
|
|
});
|
|
|
|
describe('workers/repository/changelog/index', () => {
|
|
it('embedChangelogs', async () => {
|
|
mockedFunction(getChangeLogJSON).mockResolvedValueOnce({
|
|
hasReleaseNotes: true,
|
|
});
|
|
mockedFunction(getChangeLogJSON).mockResolvedValueOnce(null);
|
|
const branches = [
|
|
partial<BranchUpgradeConfig>({ logJSON: null }),
|
|
partial<BranchUpgradeConfig>(),
|
|
partial<BranchUpgradeConfig>(),
|
|
];
|
|
await expect(embedChangelogs(branches)).toResolve();
|
|
expect(branches).toEqual([
|
|
{ logJSON: null },
|
|
{ logJSON: { hasReleaseNotes: true } },
|
|
{ logJSON: null },
|
|
]);
|
|
});
|
|
});
|