unexpected
Advanced tools
Comparing version 5.0.0-beta3 to 5.0.0-beta4
@@ -16,5 +16,5 @@ var utils = require('./utils'); | ||
inspect: function (value, depth, output, inspect) { | ||
output.append(this.prefix); | ||
output.append(this.prefix(output.clone())); | ||
output.append(inspect(this.unwrap(value))); | ||
return output.append(this.suffix); | ||
return output.append(this.suffix(output.clone())); | ||
}, | ||
@@ -25,10 +25,8 @@ diff: function (actual, expected, output, diff, inspect) { | ||
var comparison = diff(actual, expected); | ||
if (!comparison) { | ||
return null; | ||
} | ||
if (comparison.inline) { | ||
var prefixOutput = this.prefix(output.clone()); | ||
var suffixOutput = this.suffix(output.clone()); | ||
if (comparison && comparison.inline) { | ||
return { | ||
inline: true, | ||
diff: output.append(this.prefix).append(comparison.diff).append(this.suffix) | ||
diff: output.append(prefixOutput).append(comparison.diff).append(suffixOutput) | ||
}; | ||
@@ -38,8 +36,10 @@ } else { | ||
inline: true, | ||
diff: output.append(this.prefix).nl() | ||
diff: output.append(prefixOutput).nl() | ||
.indentLines() | ||
.i().block(function () { | ||
this.append(inspect(actual)).block(function () { | ||
this.error('should be: ').block(inspect(expected)).nl() | ||
.append(comparison.diff); | ||
this.error('should be: ').block(inspect(expected)); | ||
if (comparison) { | ||
this.nl().append(comparison.diff); | ||
} | ||
this.prependLinesWith(function () { | ||
@@ -51,3 +51,3 @@ this.error(' // '); | ||
.outdentLines() | ||
.append(this.suffix) | ||
.append(suffixOutput) | ||
}; | ||
@@ -54,0 +54,0 @@ } |
{ | ||
"name": "unexpected", | ||
"version": "5.0.0-beta3", | ||
"version": "5.0.0-beta4", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1136067
35
10412