Merge branch 'master' of https://github.com/mmmichl/jasmine into mmmichl-master
- Merges #1283 from @mmmichl
This commit is contained in:
@@ -1066,7 +1066,14 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
var message = 'Failed';
|
||||
if (error) {
|
||||
message += ': ';
|
||||
message += error.message || error;
|
||||
if (error.message) {
|
||||
message += error.message;
|
||||
} else if (jasmine.isString_(error)) {
|
||||
message += error;
|
||||
} else {
|
||||
// pretty print all kind of objects. This includes arrays.
|
||||
message += jasmine.pp(error);
|
||||
}
|
||||
}
|
||||
|
||||
currentRunnable().addExpectationResult(false, {
|
||||
|
||||
@@ -181,6 +181,12 @@ describe("Env integration", function() {
|
||||
}
|
||||
})]
|
||||
}));
|
||||
expect(specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
||||
description: 'pretty prints objects',
|
||||
failedExpectations: [jasmine.objectContaining({
|
||||
message: 'Failed: Object({ prop: \'value\', arr: [ \'works\', true ] })'
|
||||
})]
|
||||
}));
|
||||
done();
|
||||
}
|
||||
});
|
||||
@@ -197,6 +203,10 @@ describe("Env integration", function() {
|
||||
env.it('has a message and stack trace from an Error', function() {
|
||||
env.fail(new Error('error message'));
|
||||
});
|
||||
|
||||
env.it('pretty prints objects', function() {
|
||||
env.fail({prop: 'value', arr: ['works', true]});
|
||||
})
|
||||
});
|
||||
|
||||
env.execute();
|
||||
|
||||
@@ -523,7 +523,14 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
var message = 'Failed';
|
||||
if (error) {
|
||||
message += ': ';
|
||||
message += error.message || error;
|
||||
if (error.message) {
|
||||
message += error.message;
|
||||
} else if (jasmine.isString_(error)) {
|
||||
message += error;
|
||||
} else {
|
||||
// pretty print all kind of objects. This includes arrays.
|
||||
message += jasmine.pp(error);
|
||||
}
|
||||
}
|
||||
|
||||
currentRunnable().addExpectationResult(false, {
|
||||
|
||||
Reference in New Issue
Block a user