mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-10 14:06:30 +00:00
refactor: Fix return type for filterInternalChecks
function (#31259)
This commit is contained in:
parent
00a4cf733c
commit
a91d646b2c
2 changed files with 10 additions and 11 deletions
|
@ -61,7 +61,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(0);
|
||||
expect(res.release.version).toBe('1.0.4');
|
||||
expect(res.release?.version).toBe('1.0.4');
|
||||
});
|
||||
|
||||
it('returns non-pending latest release if internalChecksFilter=flexible and none pass checks', async () => {
|
||||
|
@ -76,7 +76,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(0);
|
||||
expect(res.release.version).toBe('1.0.4');
|
||||
expect(res.release?.version).toBe('1.0.4');
|
||||
});
|
||||
|
||||
it('returns pending latest release if internalChecksFilter=strict and none pass checks', async () => {
|
||||
|
@ -91,7 +91,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeTrue();
|
||||
expect(res.pendingReleases).toHaveLength(0);
|
||||
expect(res.release.version).toBe('1.0.4');
|
||||
expect(res.release?.version).toBe('1.0.4');
|
||||
});
|
||||
|
||||
it('returns non-latest release if internalChecksFilter=strict and some pass checks', async () => {
|
||||
|
@ -106,7 +106,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(2);
|
||||
expect(res.release.version).toBe('1.0.2');
|
||||
expect(res.release?.version).toBe('1.0.2');
|
||||
});
|
||||
|
||||
it('returns non-latest release if internalChecksFilter=flexible and some pass checks', async () => {
|
||||
|
@ -121,7 +121,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(2);
|
||||
expect(res.release.version).toBe('1.0.2');
|
||||
expect(res.release?.version).toBe('1.0.2');
|
||||
});
|
||||
|
||||
it('picks up minimumReleaseAge settings from hostRules', async () => {
|
||||
|
@ -139,7 +139,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(0);
|
||||
expect(res.release.version).toBe('1.0.4');
|
||||
expect(res.release?.version).toBe('1.0.4');
|
||||
});
|
||||
|
||||
it('picks up minimumReleaseAge settings from updateType', async () => {
|
||||
|
@ -154,7 +154,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(1);
|
||||
expect(res.release.version).toBe('1.0.3');
|
||||
expect(res.release?.version).toBe('1.0.3');
|
||||
});
|
||||
|
||||
it('picks up minimumConfidence settings from updateType', async () => {
|
||||
|
@ -174,7 +174,7 @@ describe('workers/repository/process/lookup/filter-checks', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res.pendingChecks).toBeFalse();
|
||||
expect(res.pendingReleases).toHaveLength(3);
|
||||
expect(res.release.version).toBe('1.0.1');
|
||||
expect(res.release?.version).toBe('1.0.1');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ import type { LookupUpdateConfig, UpdateResult } from './types';
|
|||
import { getUpdateType } from './update-type';
|
||||
|
||||
export interface InternalChecksResult {
|
||||
release: Release;
|
||||
release?: Release;
|
||||
pendingChecks: boolean;
|
||||
pendingReleases?: Release[];
|
||||
}
|
||||
|
@ -117,6 +117,5 @@ export async function filterInternalChecks(
|
|||
}
|
||||
}
|
||||
|
||||
// TODO #22198
|
||||
return { release: release!, pendingChecks, pendingReleases };
|
||||
return { release, pendingChecks, pendingReleases };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue