unexpected
Advanced tools
Comparing version 5.0.0-beta24 to 5.0.0-beta25
@@ -21,5 +21,7 @@ function Assertion(expect, subject, testDescription, flags, alternations, args) { | ||
if (this.args.length > 0) { | ||
var previousArgWasMagicPen = false; | ||
this.args.forEach(function (arg, index) { | ||
var isMagicPen = arg && arg.isMagicPen; | ||
if (0 < index) { | ||
if (index !== this.assertionIndex && index - 1 !== this.assertionIndex) { | ||
if (!isMagicPen && !previousArgWasMagicPen) { | ||
argsOutput.text(','); | ||
@@ -29,7 +31,8 @@ } | ||
} | ||
if (index === this.assertionIndex) { | ||
argsOutput.text(arg); | ||
if (isMagicPen) { | ||
argsOutput.append(arg); | ||
} else { | ||
argsOutput.append(expect.inspect(arg)); | ||
} | ||
previousArgWasMagicPen = isMagicPen; | ||
}, this); | ||
@@ -73,4 +76,5 @@ } | ||
Assertion.prototype.shift = function (expect, subject, assertionIndex) { | ||
this.assertionIndex = assertionIndex; | ||
expect.apply(expect, [subject].concat(this.args.slice(assertionIndex))); | ||
var rest = this.args.slice(assertionIndex); | ||
this.args[assertionIndex] = expect.output.clone().error(this.args[assertionIndex]); | ||
expect.apply(expect, [subject].concat(rest)); | ||
}; | ||
@@ -77,0 +81,0 @@ |
@@ -1,2 +0,1 @@ | ||
/*global window*/ | ||
var Assertion = require('./Assertion'); | ||
@@ -460,3 +459,3 @@ var utils = require('./utils'); | ||
if (outputFormat === 'html') { | ||
outputFormat = typeof window !== 'undefined' && window.mochaPhantomJS ? 'ansi' : 'text'; | ||
outputFormat = 'text'; | ||
err.htmlMessage = message.toString('html'); | ||
@@ -463,0 +462,0 @@ } |
{ | ||
"name": "unexpected", | ||
"version": "5.0.0-beta24", | ||
"version": "5.0.0-beta25", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"leven": "1.0.0", | ||
"magicpen": "3.0.7" | ||
"magicpen": "3.0.9" | ||
}, | ||
@@ -33,3 +33,3 @@ "devDependencies": { | ||
"es5-shim": "4.0.5", | ||
"istanbul": "^0.3.0", | ||
"istanbul": "0.3.5", | ||
"jshint": "2.5.6", | ||
@@ -36,0 +36,0 @@ "mocha": "2.0.1", |
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
494214
19
11069
+ Addedmagicpen@3.0.9(transitive)
- Removedmagicpen@3.0.7(transitive)
Updatedmagicpen@3.0.9