[Pkg-javascript-commits] [node-tap-mocha-reporter] 49/137: runner: Track found/wanted properly for diffing

Bastien Roucariès rouca at moszumanska.debian.org
Thu Sep 7 09:49:25 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 e9ed0860b0372b603f5116ba49f8a8d28b18a7d1
Author: isaacs <i at izs.me>
Date:   Sat May 2 10:03:47 2015 -0700

    runner: Track found/wanted properly for diffing
---
 lib/runner.js | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/lib/runner.js b/lib/runner.js
index 836570a..b1df12d 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -283,20 +283,24 @@ function getError (result) {
     }
   }
 
+  var diag = result.diag
+
   if (err.stack)
     err.stack = err.toString() + '\n' + reviveStack(err.stack)
 
-  var hasFound = Object.prototype.hasOwnProperty.call(result, 'found')
-  var hasWanted = Object.prototype.hasOwnProperty.call(result, 'wanted')
+  if (diag) {
+    var hasFound = diag.hasOwnProperty('found')
+    var hasWanted = diag.hasOwnProperty('wanted')
 
-  if (hasFound)
-    err.actual = result.found
+    if (hasFound)
+      err.actual = diag.found
 
-  if (hasWanted)
-    err.expected = result.wanted
+    if (hasWanted)
+      err.expected = diag.wanted
 
-  if (hasFound && hasWanted)
-    err.showDiff = true
+    if (hasFound && hasWanted)
+      err.showDiff = true
+  }
 
   return err
 }

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