Skip to content
Snippets Groups Projects
Commit b2b0e424 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: do not jump unstable majors unless configured to do so

parent 7afdfc4e
No related merge requests found
......@@ -91,6 +91,13 @@ function determineUpgrades(npmDep, config) {
stable.is(changeLogFromVersion) &&
!stable.is(version)
)
// Do not jump to a new major unstable just because the current is unstable
.reject(
version =>
config.ignoreUnstable &&
!stable.is(version) &&
semver.major(version) > semver.major(changeLogFromVersion)
)
// Ignore versions newer than "latest", unless current version is newer than the "latest"
.reject(
version =>
......
This diff is collapsed.
......@@ -3,6 +3,7 @@ const qJson = require('../../_fixtures/npm/01.json');
const helmetJson = require('../../_fixtures/npm/02.json');
const coffeelintJson = require('../../_fixtures/npm/coffeelint.json');
const webpackJson = require('../../_fixtures/npm/webpack.json');
const nextJson = require('../../_fixtures/npm/next.json');
let config;
......@@ -346,6 +347,12 @@ describe('workers/package/versions', () => {
const res = versions.determineUpgrades(webpackJson, config);
expect(res).toHaveLength(3);
});
it('does not jump major unstable', () => {
config.currentVersion = '^4.4.0-canary.3';
config.pinVersions = false;
const res = versions.determineUpgrades(nextJson, config);
expect(res).toHaveLength(0);
});
});
describe('.isRange(input)', () => {
it('rejects simple semver', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment