[Pkg-javascript-commits] [node-tap-mocha-reporter] 16/137: use exit-code rather than sniffing version

Bastien Roucariès rouca at moszumanska.debian.org
Thu Sep 7 09:49:22 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-mocha-reporter.

commit bff0b8160c75ef23808de21624d0d0e2e910c019
Author: isaacs <i at izs.me>
Date:   Sat Apr 25 14:08:50 2015 -0700

    use exit-code rather than sniffing version
---
 index.js     | 14 +++++---------
 package.json |  1 +
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/index.js b/index.js
index 6c61676..dbace81 100644
--- a/index.js
+++ b/index.js
@@ -7,6 +7,7 @@ var reporters = require('./lib/reporters/index.js')
 var Writable = require('stream').Writable
 var Runner = require('./lib/runner.js')
 var Parser = require('tap-parser')
+require('exit-code')
 
 util.inherits(Formatter, Writable)
 
@@ -27,11 +28,8 @@ function Formatter (type, options) {
     }
     this.end = p.end.bind(p)
     p.on('complete', function () {
-      if (!p.ok) {
-        process.nextTick(function () {
-          process.exit(1)
-        })
-      }
+      if (!p.ok)
+        process.exitCode = 1
     })
     return this
   }
@@ -41,10 +39,8 @@ function Formatter (type, options) {
   Writable.call(this, options)
 
   runner.on('end', function () {
-    process.nextTick(function () {
-      if (!runner.parser.ok)
-        process.exit(1)
-    })
+    if (!runner.parser.ok)
+      process.exitCode = 1
   })
 }
 
diff --git a/package.json b/package.json
index 7b91888..c6d1aea 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
   },
   "homepage": "https://github.com/isaacs/tap-spec-reporter",
   "dependencies": {
+    "exit-code": "^1.0.1",
     "supports-color": "^1.3.1",
     "tap-parser": "^1.0.4"
   },

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap-mocha-reporter.git



More information about the Pkg-javascript-commits mailing list