Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
non-working naive patch to get chai to tell mocha to do a string diff on assertion failures
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
Something went wrong with that request. Please try again.