diff --git a/lib/workers/pr/changelog/__snapshots__/github.spec.ts.snap b/lib/workers/pr/changelog/__snapshots__/github.spec.ts.snap index 28909eddbc21be049f6f90a2f93891a1331f8be8..10deb948896f02f9217d276bb2b5045d925c972e 100644 --- a/lib/workers/pr/changelog/__snapshots__/github.spec.ts.snap +++ b/lib/workers/pr/changelog/__snapshots__/github.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/pr/changelog getChangeLogJSON filters unnecessary warns 1`] = ` +exports[`workers/pr/changelog/github getChangeLogJSON filters unnecessary warns 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -51,7 +51,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and github enterprise changelog 1`] = ` +exports[`workers/pr/changelog/github getChangeLogJSON supports github enterprise and github enterprise changelog 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -102,7 +102,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and github.com changelog 1`] = ` +exports[`workers/pr/changelog/github getChangeLogJSON supports github enterprise and github.com changelog 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -153,7 +153,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON supports node engines 1`] = ` +exports[`workers/pr/changelog/github getChangeLogJSON supports node engines 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -204,7 +204,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON uses GitHub tags 1`] = ` +exports[`workers/pr/changelog/github getChangeLogJSON uses GitHub tags 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -255,7 +255,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON works without Github 1`] = ` +exports[`workers/pr/changelog/github getChangeLogJSON works without Github 1`] = ` Object { "hasReleaseNotes": true, "project": Object { diff --git a/lib/workers/pr/changelog/__snapshots__/gitlab.spec.ts.snap b/lib/workers/pr/changelog/__snapshots__/gitlab.spec.ts.snap index 5f394fc746a9b6143d26e9c5a591cbb03102cf50..fe891bae240a181e91257fc67dfe7e79ca9040a5 100644 --- a/lib/workers/pr/changelog/__snapshots__/gitlab.spec.ts.snap +++ b/lib/workers/pr/changelog/__snapshots__/gitlab.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/pr/changelog getChangeLogJSON handles empty GitLab tags response 1`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON handles empty GitLab tags response 1`] = ` Object { "hasReleaseNotes": false, "project": Object { @@ -43,7 +43,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON handles empty GitLab tags response 2`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON handles empty GitLab tags response 2`] = ` Array [ Object { "headers": Object { @@ -147,7 +147,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON supports gitlab enterprise and gitlab enterprise changelog 1`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON supports gitlab enterprise and gitlab enterprise changelog 1`] = ` Object { "hasReleaseNotes": false, "project": Object { @@ -190,7 +190,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON uses GitLab tags 1`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON uses GitLab tags 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -249,7 +249,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON uses GitLab tags 2`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON uses GitLab tags 2`] = ` Array [ Object { "headers": Object { @@ -353,7 +353,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON uses GitLab tags with error 1`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON uses GitLab tags with error 1`] = ` Object { "hasReleaseNotes": false, "project": Object { @@ -396,7 +396,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON uses GitLab tags with error 2`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON uses GitLab tags with error 2`] = ` Array [ Object { "headers": Object { @@ -500,7 +500,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON works without GitLab 1`] = ` +exports[`workers/pr/changelog/gitlab getChangeLogJSON works without GitLab 1`] = ` Object { "hasReleaseNotes": false, "project": Object { diff --git a/lib/workers/pr/changelog/__snapshots__/index.spec.ts.snap b/lib/workers/pr/changelog/__snapshots__/index.spec.ts.snap index fa7ea9e4cfcfdb6937244e304272e6e0a6cc6a11..1907c0668829869ad02c00027aed2c1007029f3e 100644 --- a/lib/workers/pr/changelog/__snapshots__/index.spec.ts.snap +++ b/lib/workers/pr/changelog/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/pr/changelog getChangeLogJSON filters unnecessary warns 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON filters unnecessary warns 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -51,7 +51,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON filters unnecessary warns 2`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON filters unnecessary warns 2`] = ` Array [ Object { "headers": Object { @@ -155,7 +155,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and github enterprise changelog 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports github enterprise and github enterprise changelog 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -206,7 +206,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and github enterprise changelog 2`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports github enterprise and github enterprise changelog 2`] = ` Array [ Object { "headers": Object { @@ -310,7 +310,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and github.com changelog 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports github enterprise and github.com changelog 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -361,7 +361,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and github.com changelog 2`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports github enterprise and github.com changelog 2`] = ` Array [ Object { "headers": Object { @@ -465,7 +465,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON supports github.com and github enterprise changelog 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports github.com and github enterprise changelog 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -516,7 +516,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON supports github.com and github enterprise changelog 2`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports github.com and github enterprise changelog 2`] = ` Array [ Object { "headers": Object { @@ -620,7 +620,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON supports node engines 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON supports node engines 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -671,7 +671,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON uses GitHub tags 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON uses GitHub tags 1`] = ` Object { "hasReleaseNotes": true, "project": Object { @@ -726,7 +726,7 @@ Object { } `; -exports[`workers/pr/changelog getChangeLogJSON uses GitHub tags 2`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON uses GitHub tags 2`] = ` Array [ Object { "headers": Object { @@ -830,7 +830,7 @@ Array [ ] `; -exports[`workers/pr/changelog getChangeLogJSON works without Github 1`] = ` +exports[`workers/pr/changelog/index getChangeLogJSON works without Github 1`] = ` Object { "hasReleaseNotes": true, "project": Object { diff --git a/lib/workers/pr/changelog/__snapshots__/release-notes.spec.ts.snap b/lib/workers/pr/changelog/__snapshots__/release-notes.spec.ts.snap index b1d3afabd870afc1dc862444a3b841ce80eb3baa..5d3ba16627c2374586c31ee32e26eba6d5442a45 100644 --- a/lib/workers/pr/changelog/__snapshots__/release-notes.spec.ts.snap +++ b/lib/workers/pr/changelog/__snapshots__/release-notes.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/pr/release-notes addReleaseNotes() returns ChangeLogResult 1`] = ` +exports[`workers/pr/changelog/release-notes addReleaseNotes() returns ChangeLogResult 1`] = ` Object { "a": 1, "hasReleaseNotes": false, @@ -19,7 +19,7 @@ Object { } `; -exports[`workers/pr/release-notes addReleaseNotes() returns ChangeLogResult without release notes 1`] = ` +exports[`workers/pr/changelog/release-notes addReleaseNotes() returns ChangeLogResult without release notes 1`] = ` Object { "a": 1, "hasReleaseNotes": false, @@ -38,7 +38,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseList() should return release list for github repo 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseList() should return release list for github repo 1`] = ` Array [ Object { "body": undefined, @@ -57,7 +57,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseList() should return release list for github repo 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseList() should return release list for github repo 2`] = ` Array [ Object { "headers": Object { @@ -72,7 +72,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseList() should return release list for gitlab.com project 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseList() should return release list for gitlab.com project 1`] = ` Array [ Object { "body": undefined, @@ -89,7 +89,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseList() should return release list for gitlab.com project 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseList() should return release list for gitlab.com project 2`] = ` Array [ Object { "headers": Object { @@ -104,7 +104,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 1`] = ` Object { "body": "some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124) ", @@ -115,7 +115,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 2`] = ` Array [ Object { "headers": Object { @@ -130,7 +130,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body 3`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 3`] = ` Object { "body": "some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124) ", @@ -141,7 +141,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body 4`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 4`] = ` Array [ Object { "headers": Object { @@ -156,7 +156,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body 5`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 5`] = ` Object { "body": "some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124) ", @@ -167,7 +167,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body 6`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 6`] = ` Array [ Object { "headers": Object { @@ -182,9 +182,9 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body from gitlab repo 1`] = `null`; +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo 1`] = `null`; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body from gitlab repo 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo 2`] = ` Array [ Object { "headers": Object { @@ -199,9 +199,9 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body from gitlab repo other- 1`] = `null`; +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo other- 1`] = `null`; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body from gitlab repo other- 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo other- 2`] = ` Array [ Object { "headers": Object { @@ -216,9 +216,9 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body from gitlab repo v 1`] = `null`; +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo v 1`] = `null`; -exports[`workers/pr/release-notes getReleaseNotes() gets release notes with body from gitlab repo v 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo v 2`] = ` Array [ Object { "headers": Object { @@ -233,7 +233,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotes() should return null for release notes without body 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotes() should return null for release notes without body 1`] = ` Array [ Object { "headers": Object { @@ -248,7 +248,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses adapter-utils 4.33.0 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses adapter-utils 4.33.0 1`] = ` Object { "body": "- add new auth, fix accept header and base path in mock @@ -262,7 +262,7 @@ See merge request itentialopensource/adapter-utils!177 } `; -exports[`workers/pr/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses adapter-utils 4.33.0 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses adapter-utils 4.33.0 2`] = ` Array [ Object { "headers": Object { @@ -287,7 +287,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.2.0 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.2.0 1`] = ` Object { "body": "##### âš BREAKING CHANGES @@ -317,7 +317,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.2.0 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.2.0 2`] = ` Array [ Object { "headers": Object { @@ -342,7 +342,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.3.0 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.3.0 1`] = ` Object { "body": "##### Features @@ -357,7 +357,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.3.0 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() ReleaseNotes Correctness parses yargs 15.3.0 2`] = ` Array [ Object { "headers": Object { @@ -382,7 +382,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() handles bad markdown 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() handles bad markdown 1`] = ` Array [ Object { "headers": Object { @@ -407,7 +407,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() handles files mismatch 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() handles files mismatch 1`] = ` Array [ Object { "headers": Object { @@ -422,7 +422,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() handles wrong format 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() handles wrong format 1`] = ` Array [ Object { "headers": Object { @@ -447,7 +447,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses angular.js 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses angular.js 1`] = ` Object { "body": "#### Bug Fixes @@ -477,7 +477,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses angular.js 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses angular.js 2`] = ` Array [ Object { "headers": Object { @@ -502,7 +502,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses gitlab.com/gitlab-org/gitter/webapp 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses gitlab.com/gitlab-org/gitter/webapp 1`] = ` Object { "body": "- Removing markup from a part of the French translation, <https://gitlab.com/gitlab-org/gitter/webapp/-/merge_requests/1878> - Fix typo documentation -> documentation, <https://gitlab.com/gitlab-org/gitter/webapp/-/merge_requests/1880> @@ -518,7 +518,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses gitlab.com/gitlab-org/gitter/webapp 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses gitlab.com/gitlab-org/gitter/webapp 2`] = ` Array [ Object { "headers": Object { @@ -543,7 +543,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses jest 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses jest 1`] = ` Object { "body": "##### Fixes @@ -735,7 +735,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses jest 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses jest 2`] = ` Array [ Object { "headers": Object { @@ -760,7 +760,7 @@ Array [ ] `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses js-yaml 1`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses js-yaml 1`] = ` Object { "body": "- Fix \`condenseFlow\` output (quote keys for sure, instead of spaces), [#371](https://github.com/nodeca/js-yaml/issues/371), [#370](https://github.com/nodeca/js-yaml/issues/370). - Dump astrals as codepoints instead of surrogate pair, [#368](https://github.com/nodeca/js-yaml/issues/368). @@ -769,7 +769,7 @@ Object { } `; -exports[`workers/pr/release-notes getReleaseNotesMd() parses js-yaml 2`] = ` +exports[`workers/pr/changelog/release-notes getReleaseNotesMd() parses js-yaml 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/workers/pr/changelog/common.ts b/lib/workers/pr/changelog/common.ts index 36d83387aeece262c802fd175f93d28008effdcb..3ae81316b6a54d9ad45713b69f8ec49596529b01 100644 --- a/lib/workers/pr/changelog/common.ts +++ b/lib/workers/pr/changelog/common.ts @@ -40,3 +40,8 @@ export interface ChangeLogResult { versions?: ChangeLogRelease[]; error?: ChangeLogError; } + +export interface ChangeLogFile { + changelogFile: string; + changelogMd: string; +} diff --git a/lib/workers/pr/changelog/github.spec.ts b/lib/workers/pr/changelog/github.spec.ts index 9d0d05769663b9781ea0ac21edcf7d74aa68b25f..aa562938425ae125ca50883d4a262b06d8dd269f 100644 --- a/lib/workers/pr/changelog/github.spec.ts +++ b/lib/workers/pr/changelog/github.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../../../test/util'; import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms'; import * as hostRules from '../../../util/host-rules'; import * as semverVersioning from '../../../versioning/semver'; @@ -28,7 +29,7 @@ const upgrade: BranchUpgradeConfig = { ], }; -describe('workers/pr/changelog', () => { +describe(getName(__filename), () => { describe('getChangeLogJSON', () => { beforeEach(() => { hostRules.clear(); diff --git a/lib/workers/pr/changelog/gitlab.spec.ts b/lib/workers/pr/changelog/gitlab.spec.ts index f069c020a560affc8d985cbb9011e44936b26232..04e711c215d854d7d049e77d418cabc76693ff00 100644 --- a/lib/workers/pr/changelog/gitlab.spec.ts +++ b/lib/workers/pr/changelog/gitlab.spec.ts @@ -1,4 +1,5 @@ import * as httpMock from '../../../../test/httpMock'; +import { getName } from '../../../../test/util'; import { PLATFORM_TYPE_GITLAB } from '../../../constants/platforms'; import * as hostRules from '../../../util/host-rules'; import * as semverVersioning from '../../../versioning/semver'; @@ -30,7 +31,7 @@ const upgrade: BranchUpgradeConfig = { const baseUrl = 'https://gitlab.com/'; -describe('workers/pr/changelog', () => { +describe(getName(__filename), () => { describe('getChangeLogJSON', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/workers/pr/changelog/index.spec.ts b/lib/workers/pr/changelog/index.spec.ts index 9256159a83a81114da305330eb237b7abd2a0535..d7d9071fe60315552579c6fddaff7085b8ab9726 100644 --- a/lib/workers/pr/changelog/index.spec.ts +++ b/lib/workers/pr/changelog/index.spec.ts @@ -1,5 +1,5 @@ import * as httpMock from '../../../../test/httpMock'; -import { partial } from '../../../../test/util'; +import { getName, partial } from '../../../../test/util'; import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms'; import * as hostRules from '../../../util/host-rules'; import * as semverVersioning from '../../../versioning/semver'; @@ -31,7 +31,7 @@ const upgrade: BranchConfig = partial<BranchConfig>({ ], }); -describe('workers/pr/changelog', () => { +describe(getName(__filename), () => { describe('getChangeLogJSON', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/workers/pr/changelog/release-notes.spec.ts b/lib/workers/pr/changelog/release-notes.spec.ts index 484773d0c833537b32bc6a599475d5d7da010f12..b5d6ff881b602e1286cfcff535f4c4637fff40e5 100644 --- a/lib/workers/pr/changelog/release-notes.spec.ts +++ b/lib/workers/pr/changelog/release-notes.spec.ts @@ -1,5 +1,6 @@ import fs from 'fs-extra'; import * as httpMock from '../../../../test/httpMock'; +import { getName } from '../../../../test/util'; import { ChangeLogNotes } from './common'; import { addReleaseNotes, @@ -43,7 +44,7 @@ const contentsResponse = [ { name: 'README.md' }, ]; -describe('workers/pr/release-notes', () => { +describe(getName(__filename), () => { beforeEach(() => { httpMock.setup(); }); diff --git a/lib/workers/pr/changelog/release-notes.ts b/lib/workers/pr/changelog/release-notes.ts index efcdb23cbe4badd36c6572ca571ee57f48101a2b..09859f2fdffdfeb5a8366aa35640ea1c4fcdf976 100644 --- a/lib/workers/pr/changelog/release-notes.ts +++ b/lib/workers/pr/changelog/release-notes.ts @@ -8,7 +8,7 @@ import * as memCache from '../../../util/cache/memory'; import * as packageCache from '../../../util/cache/package'; import { GithubHttp } from '../../../util/http/github'; import { GitlabHttp } from '../../../util/http/gitlab'; -import { ChangeLogNotes, ChangeLogResult } from './common'; +import { ChangeLogFile, ChangeLogNotes, ChangeLogResult } from './common'; const markdown = new MarkdownIt('zero'); markdown.enable(['heading', 'lheading']); @@ -195,7 +195,7 @@ function isUrl(url: string): boolean { export async function getReleaseNotesMdFileInner( repository: string, apiBaseUrl: string -): Promise<{ changelogFile: string; changelogMd: string }> | null { +): Promise<ChangeLogFile> | null { let changelogFile: string; let apiTree: string; let apiFiles: string; @@ -252,7 +252,7 @@ export async function getReleaseNotesMdFileInner( export function getReleaseNotesMdFile( repository: string, apiBaseUrl: string -): Promise<{ changelogFile: string; changelogMd: string }> | null { +): Promise<ChangeLogFile> | null { const cacheKey = `getReleaseNotesMdFile-${repository}-${apiBaseUrl}`; const cachedResult = memCache.get(cacheKey); // istanbul ignore if diff --git a/lib/workers/pr/changelog/releases.spec.ts b/lib/workers/pr/changelog/releases.spec.ts index 03defd33f0aaa563d31d79934506b08170ecfb7f..7e590f660473fb83dd51825703a9e2c30a52b534 100644 --- a/lib/workers/pr/changelog/releases.spec.ts +++ b/lib/workers/pr/changelog/releases.spec.ts @@ -1,4 +1,4 @@ -import { mocked, partial } from '../../../../test/util'; +import { getName, mocked, partial } from '../../../../test/util'; import * as datasource from '../../../datasource'; import * as dockerVersioning from '../../../versioning/docker'; import * as npmVersioning from '../../../versioning/npm'; @@ -9,7 +9,7 @@ jest.mock('../../../datasource'); const ds = mocked(datasource); -describe('workers/pr/changelog/releases', () => { +describe(getName(__filename), () => { describe('getReleaseNotes()', () => { beforeEach(() => { ds.getPkgReleases.mockResolvedValueOnce({