Created
October 7, 2012 18:52
-
-
Save elliotf/3849227 to your computer and use it in GitHub Desktop.
non-working naive patch to get chai to tell mocha to do a string diff on assertion failures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/chai.js b/chai.js | |
index 040abee..87971a8 100644 | |
--- a/chai.js | |
+++ b/chai.js | |
@@ -277,6 +277,7 @@ | |
this.actual = options.actual; | |
this.expected = options.expected; | |
this.operator = options.operator; | |
+ this.showDiff = true; | |
if (options.stackStartFunction && Error.captureStackTrace) { | |
var stackStartFunction = options.stackStartFunction; | |
diff --git a/lib/chai/browser/error.js b/lib/chai/browser/error.js | |
index c0ac239..d8bcbff 100644 | |
--- a/lib/chai/browser/error.js | |
+++ b/lib/chai/browser/error.js | |
@@ -12,6 +12,7 @@ function AssertionError (options) { | |
this.actual = options.actual; | |
this.expected = options.expected; | |
this.operator = options.operator; | |
+ this.showDiff = true; | |
if (options.stackStartFunction && Error.captureStackTrace) { | |
var stackStartFunction = options.stackStartFunction; | |
diff --git a/lib/chai/error.js b/lib/chai/error.js | |
index e3c2fcc..22b69cf 100644 | |
--- a/lib/chai/error.js | |
+++ b/lib/chai/error.js | |
@@ -33,6 +33,7 @@ function AssertionError (options) { | |
this.actual = options.actual; | |
this.expected = options.expected; | |
this.operator = options.operator; | |
+ this.showDiff = true; | |
if (options.stackStartFunction && Error.captureStackTrace) { | |
var stackStartFunction = options.stackStartFunction; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment