mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
fix: return empty travis updates if no support policy set
No longer defaults to supportPolicy=[‘lts’] when supportPolicy is undefined. BREAKING CHANGE: If you wish to use travis with supportPolicy=lts, then you need to explicitly set that in node or travis config.
This commit is contained in:
parent
1f63173194
commit
e6e28a62fb
2 changed files with 8 additions and 2 deletions
|
@ -17,9 +17,9 @@ const policies = {
|
|||
|
||||
async function getPackageUpdates(config) {
|
||||
logger.debug('travis.getPackageUpdates()');
|
||||
let { supportPolicy } = config;
|
||||
const { supportPolicy } = config;
|
||||
if (!(supportPolicy && supportPolicy.length)) {
|
||||
supportPolicy = ['lts'];
|
||||
return [];
|
||||
}
|
||||
for (const policy of supportPolicy) {
|
||||
if (!Object.keys(policies).includes(policy)) {
|
||||
|
|
|
@ -12,6 +12,10 @@ describe('lib/workers/package/node', () => {
|
|||
...defaultConfig,
|
||||
};
|
||||
});
|
||||
it('returns empty if missing supportPolicy', async () => {
|
||||
config.currentVersion = ['6', '8'];
|
||||
expect(await node.getPackageUpdates(config)).toEqual([]);
|
||||
});
|
||||
it('returns empty if invalid supportPolicy', async () => {
|
||||
config.currentVersion = ['6', '8'];
|
||||
config.supportPolicy = ['foo'];
|
||||
|
@ -24,10 +28,12 @@ describe('lib/workers/package/node', () => {
|
|||
});
|
||||
it('returns result if needing updates', async () => {
|
||||
config.currentVersion = ['6', '8'];
|
||||
config.supportPolicy = ['lts'];
|
||||
expect(await node.getPackageUpdates(config)).toMatchSnapshot();
|
||||
});
|
||||
it('detects pinning', async () => {
|
||||
config.currentVersion = ['6.1.0', '8.4.0'];
|
||||
config.supportPolicy = ['lts'];
|
||||
githubDatasource.getRepoReleases.mockReturnValueOnce([
|
||||
'v4.4.4',
|
||||
'v5.5.5',
|
||||
|
|
Loading…
Reference in a new issue