[Pkg-javascript-commits] [node-tap-mocha-reporter] 46/137: Provide source to reporters, if available

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 3c0d3d035ab55cfcd8bffa4b12a983c77db3e707
Author: isaacs <i at izs.me>
Date:   Thu Apr 30 00:27:51 2015 -0400

    Provide source to reporters, if available
---
 lib/test.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/test.js b/lib/test.js
index 15d5030..a641b14 100644
--- a/lib/test.js
+++ b/lib/test.js
@@ -9,6 +9,14 @@ function Test (result, parent) {
   this.title = result.name
   this.state = result.ok ? 'pass' : 'failed'
   this.pending = result.todo || result.skip || false
+  if (result.diag && result.diag.source) {
+    var source = result.diag.source
+    this.fn = {
+      toString: function () {
+        return 'function(){' + source + '\n}'
+      }
+    }
+  }
 
   Object.defineProperty(this, 'parent', {
     value: parent,
@@ -28,6 +36,6 @@ Test.prototype.slow = function (ms){
 
 Test.prototype.fn = {
   toString: function () {
-    return 'function () {}'
+    return 'function () {\n}'
   }
 }

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