Skip to content

Commit

Permalink
small change to assertion fail message
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Oct 13, 2015
1 parent 23cdedf commit 228b97f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/api/client-commands/end.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ End.prototype.shouldTakeScreenshot = function() {
};

End.prototype.complete = function(callback, result) {
this.emit('complete');
if (typeof callback === 'function') {
callback.call(this, result);
}
this.emit('complete');
};

module.exports = End;
4 changes: 3 additions & 1 deletion lib/core/assertion.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ module.exports = new (function() {

try {
var err = new Error();

err.name = message;
err.message = message + ' - ' + failure;

if (originalStackTrace) {
var stackParts = originalStackTrace.split('\n');
stackParts.shift();

if (!client.options.start_session) {
stackParts.unshift('AssertionError: ' + message);
}
Expand All @@ -233,7 +235,7 @@ module.exports = new (function() {
client.results.lastError = ex;

if (client.options.output) {
if (client.options.start_session) {
if (client.options.start_session && originalStackTrace) {
console.log(Logger.colors.light_gray(stacktrace));
} else {
var parts = stacktrace.split('\n');
Expand Down

0 comments on commit 228b97f

Please sign in to comment.