btrz-health-check
Advanced tools
Comparing version 1.5.0 to 1.6.0
{ | ||
"name": "btrz-health-check", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "A series of classes that will ping different service types to verify accessibility.", | ||
@@ -10,4 +10,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "NODE_ENV=test node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- --ui bdd -t 5000", | ||
"test-w": "NODE_ENV=test node_modules/mocha/bin/mocha -w", | ||
"test": "NODE_ENV=test BUILD_NUMBER=123456789 node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- --ui bdd -t 5000", | ||
"test-w": "NODE_ENV=test BUILD_NUMBER=123456789 node_modules/mocha/bin/mocha -w", | ||
"publish": "publish" | ||
@@ -14,0 +14,0 @@ }, |
@@ -8,10 +8,6 @@ "use strict"; | ||
git() { | ||
function resolver(resolve) { | ||
git.long(function (str) { | ||
resolve(str); | ||
}); | ||
} | ||
return new Promise(resolver); | ||
buildNumber() { | ||
return process.env.BUILD_NUMBER || "0"; | ||
} | ||
ec2instanceId() { | ||
@@ -30,3 +26,13 @@ function resolver(resolve, reject) { | ||
git() { | ||
function resolver(resolve) { | ||
git.long(function (str) { | ||
resolve(str); | ||
}); | ||
} | ||
return new Promise(resolver); | ||
} | ||
values() { | ||
let self = this; | ||
return Promise.all([this.git(), this.ec2instanceId()]) | ||
@@ -36,3 +42,4 @@ .then(function (results) { | ||
commit: results[0], | ||
instanceId: results[1] | ||
instanceId: results[1], | ||
build: self.buildNumber() | ||
}; | ||
@@ -39,0 +46,0 @@ }); |
@@ -32,2 +32,3 @@ "use strict"; | ||
results[0].instanceId = results[1].instanceId; | ||
results[0].build = results[1].build; | ||
return results[0]; | ||
@@ -34,0 +35,0 @@ }); |
@@ -24,2 +24,6 @@ "use strict"; | ||
it("should return the BUILD_NUMBER", function () { | ||
expect(env.buildNumber()).to.be.eql("123456789"); | ||
}); | ||
it("should return the env variables combined", function (done) { | ||
@@ -29,2 +33,3 @@ env.values().then(function (result) { | ||
expect(result.instanceId).to.be.eql("localhost"); | ||
expect(result.build).to.be.eql("123456789"); | ||
done(); | ||
@@ -31,0 +36,0 @@ }); |
@@ -12,2 +12,3 @@ "use strict"; | ||
expect(result.commit).to.not.be.undefined; | ||
expect(result.build).to.be.eql("123456789"); | ||
done(); | ||
@@ -14,0 +15,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25043
545
1