Skip to content

Commit f99e4cc

Browse files
committed
fix(versioncheck) Allow one patch number above current version
Signed-off-by: Jerome Simeon <[email protected]>
1 parent 8f43251 commit f99e4cc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/concerto-core/changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Note that the latest public API is documented using JSDocs and is available in api.txt.
2525
#
2626

27-
Version 0.82.8 {c96bafdd4a2bb7402f6b520a0cefe537} 2020-09-09
27+
Version 0.82.9 {c96bafdd4a2bb7402f6b520a0cefe537} 2020-09-09
2828
- Add option parameters to ModelLoader
2929

3030
Version 0.82.6 {03fa6481ffdf0e58cb110c6f24009d18} 2020-02-26

packages/concerto-core/scripts/versionchecker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class VersionChecker {
6060
// check the version in package.json is up to date
6161
const packageObj = JSON.parse(packageJson);
6262

63-
if (!semver.lte(version, packageObj.version)) {
64-
throw new Error(`The version in the changelog file "${version}" is not less than or equal to the version in package.json "${packageObj.version}".`);
63+
if (!semver.lte(version, semver.inc(packageObj.version,'patch'))) {
64+
throw new Error(`The version in the changelog file "${version}" is not less than or equal to the next available version in package.json "${packageObj.version}".`);
6565
}
6666

6767
// get MD5

packages/concerto-core/test/scripts/versionchecker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ describe('VersionChecker', () => {
5757
VersionChecker.check('Version 0.0.1 {' + digest + '}', publicApi, JSON.stringify(packageJson));
5858
});
5959

60-
it('should throw if version does not match and is greater than package version', () => {
60+
it('should throw if version does not match and is greater than one patch version above package version', () => {
6161
(() => {
6262
const packageJson = { version: '0.0.2'};
6363
const publicApi = 'class Bogus{}';
6464
const digest = VersionChecker.getDigest(publicApi);
65-
VersionChecker.check('Version 0.0.3 {' + digest + '}', publicApi, JSON.stringify(packageJson));
65+
VersionChecker.check('Version 0.0.4 {' + digest + '}', publicApi, JSON.stringify(packageJson));
6666
}).should.throw(/is not less than or equal/);
6767
});
6868

0 commit comments

Comments
 (0)