[Pkg-javascript-commits] [node-tap] 121/186: Code coverage is optional
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 1 16:40:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-tap.
commit 420760cf2b1be31d9e4688110cbad725c9d760ef
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Sun Sep 10 23:11:03 2017 +0200
Code coverage is optional
Forwarded: no
---
bin/run.js | 22 +++++++++++++++++++---
package.json | 2 +-
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/bin/run.js b/bin/run.js
index ed21d01..9c62fbc 100755
--- a/bin/run.js
+++ b/bin/run.js
@@ -46,13 +46,17 @@ if (coverageServiceTest)
// Currently only Coveralls is supported, but the infrastructure
// is left in place in case some noble soul fixes the codecov
// module in the future. See https://github.com/tapjs/node-tap/issues/270
-const coverageServices = [
+var coverageServices = []
+try {
+coverageServices.push(
{
env: 'COVERALLS_REPO_TOKEN',
bin: require.resolve('coveralls/bin/coveralls.js'),
name: 'Coveralls'
}
-]
+);
+}
+catch(e) {}
const main = _ => {
const args = process.argv.slice(2)
@@ -95,7 +99,14 @@ const main = _ => {
/* istanbul ignore next */
if ((options.coverageReport || options.checkCoverage) &&
options.files.length === 0)
+ {
+ try {
return runCoverageReport(options)
+ }
+ catch(e) {
+ console.warn("Code coverage is disabled because some modules are missing")
+ }
+ }
if (options.files.length === 0) {
console.error('Reading TAP data from stdin (use "-" argument to suppress)')
@@ -113,8 +124,13 @@ const main = _ => {
// By definition, the next block cannot be covered, because
// they are only relevant when coverage is turned off.
/* istanbul ignore next */
- if (options.coverage && !global.__coverage__) {
+ if (options.coverage && !global.__coverage__)
+ {
+ try {
return respawnWithCoverage(options)
+ } catch(e) {
+ console.warn("Code coverage is disabled because some modules are missing")
+ }
}
setupTapEnv(options)
diff --git a/package.json b/package.json
index 63e6df2..208e939 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,6 @@
"bluebird": "^3.5.1",
"clean-yaml-object": "^0.1.0",
"supports-color" : "^3",
- "coveralls": "^2.13.3",
"foreground-child": "^1.3.3",
"fs-exists-cached": "^1.0.0",
"function-loop": "^1.0.1",
@@ -41,6 +40,7 @@
},
"optionalDependencies" : {
"nyc": "^11.3.0",
+ "coveralls": "^2.13.3",
"opener": "^1.4.1"
},
"keywords": [
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap.git
More information about the Pkg-javascript-commits
mailing list