From 286ab6dc407387c0d4562b45048e71a9cded318b Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Thu, 27 Feb 2020 22:13:45 +0100 Subject: [PATCH] refactor: rename getReleases -> getInRangeReleases --- lib/workers/pr/changelog/index.ts | 4 ++-- lib/workers/pr/changelog/releases.ts | 4 ++-- test/workers/pr/changelog/releases.spec.ts | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/workers/pr/changelog/index.ts b/lib/workers/pr/changelog/index.ts index 750c4fea09..bb66f1d32a 100644 --- a/lib/workers/pr/changelog/index.ts +++ b/lib/workers/pr/changelog/index.ts @@ -1,7 +1,7 @@ import { logger } from '../../../logger'; import * as allVersioning from '../../../versioning'; import * as sourceGithub from './source-github'; -import { getReleases } from './releases'; +import { getInRangeReleases } from './releases'; import { ChangeLogConfig, ChangeLogResult } from './common'; export * from './common'; @@ -18,7 +18,7 @@ export async function getChangeLogJSON( return null; } - const releases = args.releases || (await getReleases(args)); + const releases = args.releases || (await getInRangeReleases(args)); try { const res = await sourceGithub.getChangeLogJSON({ ...args, releases }); diff --git a/lib/workers/pr/changelog/releases.ts b/lib/workers/pr/changelog/releases.ts index 8c991376c5..8092906ba0 100644 --- a/lib/workers/pr/changelog/releases.ts +++ b/lib/workers/pr/changelog/releases.ts @@ -25,7 +25,7 @@ export type ReleaseConfig = PkgReleaseConfig & { toVersion: string; }; -export async function getReleases( +export async function getInRangeReleases( config: ReleaseConfig ): Promise<Release[] | null> { const { versioning, fromVersion, toVersion, depName, datasource } = config; @@ -54,7 +54,7 @@ export async function getReleases( } return releases; } catch (err) /* istanbul ignore next */ { - logger.debug({ err }, 'getReleases err'); + logger.debug({ err }, 'getInRangeReleases err'); logger.debug({ datasource, depName }, 'Error getting releases'); return null; } diff --git a/test/workers/pr/changelog/releases.spec.ts b/test/workers/pr/changelog/releases.spec.ts index cfe44276dd..89252131f6 100644 --- a/test/workers/pr/changelog/releases.spec.ts +++ b/test/workers/pr/changelog/releases.spec.ts @@ -46,7 +46,7 @@ describe('workers/pr/changelog/releases', () => { fromVersion: '1.0.0', toVersion: '1.1.0', }; - const res = await releases.getReleases(config); + const res = await releases.getInRangeReleases(config); expect(res).toMatchSnapshot(); expect(res).toHaveLength(3); }); @@ -56,7 +56,7 @@ describe('workers/pr/changelog/releases', () => { fromVersion: '1.0.1-rc0', toVersion: '1.1.0', }; - const res = await releases.getReleases(config); + const res = await releases.getInRangeReleases(config); expect(res).toMatchSnapshot(); expect(res).toHaveLength(4); }); @@ -66,7 +66,7 @@ describe('workers/pr/changelog/releases', () => { fromVersion: '1.0.1', toVersion: '1.2.0-rc1', }; - const res = await releases.getReleases(config); + const res = await releases.getInRangeReleases(config); expect(res).toMatchSnapshot(); expect(res).toHaveLength(4); }); @@ -76,7 +76,7 @@ describe('workers/pr/changelog/releases', () => { fromVersion: '1.0.1-rc0', toVersion: '1.2.0-rc1', }; - const res = await releases.getReleases(config); + const res = await releases.getInRangeReleases(config); expect(res).toMatchSnapshot(); expect(res).toHaveLength(6); }); @@ -86,7 +86,7 @@ describe('workers/pr/changelog/releases', () => { fromVersion: '1.0.1-rc0', toVersion: '1.2.0-rc0', }; - const res = await releases.getReleases(config); + const res = await releases.getInRangeReleases(config); expect(res).toMatchSnapshot(); expect(res).toHaveLength(3); }); -- GitLab