Include rejection details in failure messages for toBeResolved and toBeResolvedWith

[#178559119]
This commit is contained in:
Steve Gravrock
2021-06-21 16:43:51 -07:00
parent 163f93d6ff
commit 5862b22aef
6 changed files with 51 additions and 19 deletions

View File

@@ -19,14 +19,15 @@ describe('#toBeResolvedTo', function() {
pp: jasmineUnderTest.makePrettyPrinter()
}),
matcher = jasmineUnderTest.asyncMatchers.toBeResolvedTo(matchersUtil),
actual = Promise.reject('AsyncExpectationSpec error');
actual = Promise.reject(new Error('AsyncExpectationSpec error'));
return matcher.compare(actual, '').then(function(result) {
expect(result).toEqual(
jasmine.objectContaining({
pass: false,
message:
"Expected a promise to be resolved to '' but it was rejected."
"Expected a promise to be resolved to '' but it was rejected " +
'with Error: AsyncExpectationSpec error.'
})
);
});