aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/development/version–bump-test.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-03-07 06:59:09 +0800
committerDan Finlay <dan@danfinlay.com>2018-03-07 06:59:09 +0800
commit423f084cb47d84e2e9063a6567454f83592f424b (patch)
treebc2f3040cd76765fa27bbfc0e3913cf5e466c063 /test/unit/development/version–bump-test.js
parent8ba64c657ff801425c06db166e2c9a06289047de (diff)
parent303801d2768a264a27a51916e5debf778739ee0c (diff)
downloadtangerine-wallet-browser-423f084cb47d84e2e9063a6567454f83592f424b.tar.gz
tangerine-wallet-browser-423f084cb47d84e2e9063a6567454f83592f424b.tar.zst
tangerine-wallet-browser-423f084cb47d84e2e9063a6567454f83592f424b.zip
Merge branch 'master' into i3076-UseStorageLocalInstead
Diffstat (limited to 'test/unit/development/version–bump-test.js')
-rw-r--r--test/unit/development/version–bump-test.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/unit/development/version–bump-test.js b/test/unit/development/version–bump-test.js
new file mode 100644
index 000000000..1c445c8b4
--- /dev/null
+++ b/test/unit/development/version–bump-test.js
@@ -0,0 +1,45 @@
+const assert = require('assert')
+const versionBump = require('../../../development/version-bump')
+const { promisify } = require('util')
+const fs = require('fs')
+const readFile = promisify(fs.readFile)
+const path = require('path')
+const changelogPath = path.join(__dirname, 'sample-changelog.md')
+const manifest = require('./sample-manifest.json')
+let changelog
+
+
+describe('version bumper', function () {
+
+ beforeEach(async () => {
+ // load changelog. Mock version is 4.1.3
+ const changeBuffer = await readFile(changelogPath)
+ changelog = changeBuffer.toString()
+ })
+
+ it('returns a properly bumped major version', async function () {
+ const result = await versionBump('major', changelog, manifest)
+ const expected = '5.0.0'
+ assert.equal(result.version, expected, 'major bumps correctly')
+ assert.equal(result.manifest.version, expected, 'major bumps correctly')
+ assert.ok(result.changelog.includes(expected))
+ })
+
+ it('returns a properly bumped minor version', async function () {
+ const result = await versionBump('minor', changelog, manifest)
+ const expected = '4.2.0'
+ assert.equal(result.version, expected, 'minor bumps correctly')
+ assert.equal(result.manifest.version, expected, 'minor bumps correctly')
+ assert.ok(result.changelog.includes(expected))
+ })
+
+ it('returns a properly bumped patch version', async function () {
+ const result = await versionBump('patch', changelog, manifest)
+ const expected = '4.1.4'
+ assert.equal(result.version, expected, 'patch bumps correctly')
+ assert.equal(result.manifest.version, expected, 'patch bumps correctly')
+ assert.ok(result.changelog.includes(expected))
+ })
+})
+
+