Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 50c9f7c

Browse files
committed
fix(test): make the version test fetch the version from package.json instead of a hardcoded value
1 parent eba0398 commit 50c9f7c

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"form-data": "^1.0.0-rc4",
4848
"gulp": "^3.9.1",
4949
"idb-plus-blob-store": "^1.1.2",
50-
"interface-ipfs-core": "^0.7.0",
50+
"interface-ipfs-core": "^0.7.2",
5151
"left-pad": "^1.1.1",
5252
"lodash": "^4.14.1",
5353
"ncp": "^2.0.0",

test/cli/test-version.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const nexpect = require('nexpect')
66
const HttpAPI = require('../../src/http-api')
77
const repoPath = require('./index').repoPath
88
const _ = require('lodash')
9+
const pkgversion = require('../../package.json').version
910

1011
describe('version', () => {
1112
const env = _.clone(process.env)
@@ -16,7 +17,7 @@ describe('version', () => {
1617
nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'version'], {env})
1718
.run((err, stdout, exitcode) => {
1819
expect(err).to.not.exist
19-
expect(stdout[0]).to.equal('js-ipfs version: 0.14.1')
20+
expect(stdout[0]).to.equal('js-ipfs version: ' + pkgversion)
2021
expect(exitcode).to.equal(0)
2122
done()
2223
})
@@ -46,7 +47,7 @@ describe('version', () => {
4647
.run((err, stdout, exitcode) => {
4748
expect(err).to.not.exist
4849
expect(exitcode).to.equal(0)
49-
expect(stdout[0]).to.equal('js-ipfs version: 0.14.1')
50+
expect(stdout[0]).to.equal('js-ipfs version: ' + pkgversion)
5051
done()
5152
})
5253
})

test/core/both/test-version.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'use strict'
33

44
const expect = require('chai').expect
5+
const pkgversion = require('../../../package.json').version
56

67
const IPFS = require('../../../src/core')
78

@@ -16,7 +17,7 @@ describe('version', () => {
1617
it('get version', (done) => {
1718
ipfs.version((err, version) => {
1819
expect(err).to.not.exist
19-
expect(version).to.equal('0.14.1')
20+
expect(version).to.equal(pkgversion)
2021
done()
2122
})
2223
})

test/http-api/test-version.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
const expect = require('chai').expect
55
const APIctl = require('ipfs-api')
6+
const pkgversion = require('../../package.json').version
67

78
module.exports = (httpAPI) => {
89
describe('version', () => {
@@ -18,7 +19,7 @@ module.exports = (httpAPI) => {
1819
method: 'GET',
1920
url: '/api/v0/version'
2021
}, (res) => {
21-
expect(res.result.Version).to.equal('0.14.1')
22+
expect(res.result.Version).to.equal(pkgversion)
2223
expect(res.result).to.have.a.property('Commit')
2324
expect(res.result).to.have.a.property('Repo')
2425
done()

0 commit comments

Comments
 (0)