From e90abf39d351c572f5123ac7b90eda5d446647f8 Mon Sep 17 00:00:00 2001 From: Ed Moore Date: Thu, 16 Mar 2017 19:32:07 +1100 Subject: [PATCH 1/2] Take version from package.json --- lib/codecov.js | 2 +- test/index.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/codecov.js b/lib/codecov.js index 2bb4920e..f2ef795e 100644 --- a/lib/codecov.js +++ b/lib/codecov.js @@ -6,7 +6,7 @@ var execSync = require('child_process').execSync; var detectProvider = require('./detect'); -var version = "v1.0.1"; +var version = require('../package.json').version; var patterns = "-type f \\( -name '*coverage.*' " + "-or -name 'nosetests.xml' " + diff --git a/test/index.js b/test/index.js index 22c8ec84..8d2f7dc3 100644 --- a/test/index.js +++ b/test/index.js @@ -126,5 +126,10 @@ describe("Codecov", function(){ expect(res.debug).to.contain('find folder/path -type f -name \'*.gcno\' -not -path \'ignore/this/folder\' -exec llvm-gcov -o {} +'); }); + it('should have the correct version number', function() { + var version = require('../package.json').version + expect(codecov.version).to.eql(version) + }) + }); From e7a3a7299ef0c38730abe1f1c8758e4654dd97e9 Mon Sep 17 00:00:00 2001 From: Ed Moore Date: Thu, 16 Mar 2017 19:38:40 +1100 Subject: [PATCH 2/2] Adding `v` to the start of version --- lib/codecov.js | 2 +- test/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codecov.js b/lib/codecov.js index f2ef795e..ae6a3d8e 100644 --- a/lib/codecov.js +++ b/lib/codecov.js @@ -6,7 +6,7 @@ var execSync = require('child_process').execSync; var detectProvider = require('./detect'); -var version = require('../package.json').version; +var version = 'v' + require('../package.json').version; var patterns = "-type f \\( -name '*coverage.*' " + "-or -name 'nosetests.xml' " + diff --git a/test/index.js b/test/index.js index 8d2f7dc3..2996b636 100644 --- a/test/index.js +++ b/test/index.js @@ -128,7 +128,7 @@ describe("Codecov", function(){ it('should have the correct version number', function() { var version = require('../package.json').version - expect(codecov.version).to.eql(version) + expect(codecov.version).to.eql('v' + version) })