Skip to content

Commit

Permalink
added allowUncaught option (mochajs#553)
Browse files Browse the repository at this point in the history
fixed merge issues

fixed merge issues

fixed merge issues
  • Loading branch information
amsul committed Apr 18, 2015
1 parent 202059d commit 10dcd85
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -2189,11 +2189,9 @@ exports.list = function(failures){
if (err.showDiff !== false && sameType(actual, expected)
&& expected !== undefined) {

if ('string' !== typeof actual) {
escape = false;
err.actual = actual = utils.stringify(actual);
err.expected = expected = utils.stringify(expected);
}
escape = false;
err.actual = actual = utils.stringify(actual);
err.expected = expected = utils.stringify(expected);

fmt = color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n');
var match = message.match(/^([^:]+): expected/);
Expand Down Expand Up @@ -4581,6 +4579,10 @@ Runnable.prototype.run = function(fn){
done(reason || new Error('Promise rejected with no or falsy reason'))
});
} else {
if (self.asyncOnly) {
return done(new Error('--async-only option in use without declaring `done()` or returning a promise'));
}

done();
}
}
Expand Down Expand Up @@ -6189,7 +6191,7 @@ function jsonStringify(object, spaces, depth) {
default:
val = (val == '[Function]' || val == '[Circular]')
? val
: '"' + val + '"'; //string
: JSON.stringify(val); //string
}
return val;
}
Expand Down

0 comments on commit 10dcd85

Please sign in to comment.