[Pkg-javascript-commits] [node-tap-mocha-reporter] 76/137: Don't read .ok of undefined

Bastien Roucariès rouca at moszumanska.debian.org
Thu Sep 7 09:49:28 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 58f9d0dbb393846a4bf41bda9182e67f6d3bc84a
Author: isaacs <i at izs.me>
Date:   Wed Sep 2 16:25:37 2015 -0700

    Don't read .ok of undefined
---
 lib/runner.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/runner.js b/lib/runner.js
index 339303d..cbd0d52 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -184,14 +184,16 @@ function attachEvents (runner, parser, level) {
     if (this.doingChild) {
       var suite = this.doingChild.suite
       if (this.doingChild.name === result.name) {
-        if (suite && result.time)
-          suite.duration = result.time
-
-        // If it's ok so far, but the ending result is not-ok, then
-        // that means that it exited non-zero.  Emit the test so
-        // that we can print it as a failure.
-        if (suite.ok && !result.ok)
-          emitTest(this, result)
+        if (suite) {
+          if (result.time)
+            suite.duration = result.time
+
+          // If it's ok so far, but the ending result is not-ok, then
+          // that means that it exited non-zero.  Emit the test so
+          // that we can print it as a failure.
+          if (suite.ok && !result.ok)
+            emitTest(this, result)
+        }
       }
 
       var emitOn = this

-- 
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