mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
Fixed tests and created test case for extractVersion flow
This commit is contained in:
parent
d0d4c004bf
commit
b018a6415a
2 changed files with 32 additions and 0 deletions
|
@ -621,6 +621,37 @@ describe('workers/repository/update/pr/changelog/release-notes', () => {
|
|||
body: 'some body\n',
|
||||
});
|
||||
});
|
||||
|
||||
it('fallback to extractVersion', async () => {
|
||||
githubReleasesMock.mockResolvedValueOnce([
|
||||
{
|
||||
version: `app-1.0.0`,
|
||||
url: 'correct/url/tag.com',
|
||||
description: 'some body',
|
||||
},
|
||||
] as never);
|
||||
const res = await getReleaseNotes(
|
||||
{
|
||||
...githubProject,
|
||||
repository: 'some/other-repository',
|
||||
depName: 'exampleDep',
|
||||
},
|
||||
{
|
||||
version: '1.0.0',
|
||||
gitRef: '1.0.0',
|
||||
} as ChangeLogRelease,
|
||||
{ extractVersion: 'app-(?<version>[0-9.]*)' } as BranchUpgradeConfig
|
||||
);
|
||||
expect(res).toEqual({
|
||||
url: 'correct/url/tag.com',
|
||||
notesSourceUrl:
|
||||
'https://api.github.com/repos/some/other-repository/releases',
|
||||
id: undefined,
|
||||
tag: 'app-1.0.0',
|
||||
name: undefined,
|
||||
body: 'some body\n',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('getReleaseNotesMd()', () => {
|
||||
|
|
|
@ -566,6 +566,7 @@ describe('workers/repository/update/pr/index', () => {
|
|||
|
||||
const dummyRelease: ChangeLogRelease = {
|
||||
version: '',
|
||||
gitRef: '',
|
||||
changes: dummyChanges,
|
||||
compare: {},
|
||||
date: '',
|
||||
|
|
Loading…
Reference in a new issue