Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qiwi/multi-semantic-release
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.9.4
Choose a base ref
...
head repository: qiwi/multi-semantic-release
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.9.5
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 23, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7275ae7 View commit details
  2. chore(release): 3.9.5 [skip ci]

    ## [3.9.5](v3.9.4...v3.9.5) (2020-11-23)
    
    ### Bug Fixes
    
    * fix getNextVersion resolver ([7275ae7](7275ae7))
    qiwibot committed Nov 23, 2020
    Copy the full SHA
    c9aaf28 View commit details
Showing with 31 additions and 3 deletions.
  1. +7 −0 CHANGELOG.md
  2. +3 −1 lib/updateDeps.js
  3. +1 −1 package.json
  4. +20 −1 test/lib/updateDeps.test.js
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.9.5](https://github.com/qiwi/multi-semantic-release/compare/v3.9.4...v3.9.5) (2020-11-23)


### Bug Fixes

* fix getNextVersion resolver ([7275ae7](https://github.com/qiwi/multi-semantic-release/commit/7275ae75799ad3cb3bca34c9cfa2978fed092794))

## [3.9.4](https://github.com/qiwi/multi-semantic-release/compare/v3.9.3...v3.9.4) (2020-11-23)


4 changes: 3 additions & 1 deletion lib/updateDeps.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,9 @@ const semver = require("semver");
const getNextVersion = (pkg) => {
const lastVersion = pkg._lastRelease && pkg._lastRelease.version;

return lastVersion && typeof pkg._nextType === "string" ? semver.inc(lastVersion, pkg._nextType) : "1.0.0";
return lastVersion && typeof pkg._nextType === "string"
? semver.inc(lastVersion, pkg._nextType)
: lastVersion || "1.0.0";
};

/**
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@qiwi/multi-semantic-release",
"author": "Dave Houlbrooke <dave@shax.com>",
"version": "3.9.4",
"version": "3.9.5",
"license": "0BSD",
"engines": {
"node": ">=10.18",
21 changes: 20 additions & 1 deletion test/lib/updateDeps.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { resolveReleaseType, resolveNextVersion } = require("../../lib/updateDeps");
const { resolveReleaseType, resolveNextVersion, getNextVersion } = require("../../lib/updateDeps");

describe("resolveNextVersion()", () => {
// prettier-ignore
@@ -140,3 +140,22 @@ describe("resolveReleaseType()", () => {
});
});
});

describe("getNextVersion()", () => {
// prettier-ignore
const cases = [
[undefined, "patch", "1.0.0"],
["1.0.0", "patch", "1.0.1"],
["2.0.0", undefined, "2.0.0"],
]

cases.forEach(([lastVersion, releaseType, nextVersion]) => {
it(`${lastVersion} and ${releaseType} gives ${nextVersion}`, () => {
// prettier-ignore
expect(getNextVersion({
_nextType: releaseType,
_lastRelease: {version: lastVersion}
})).toBe(nextVersion);
});
});
});