Detailed error messages in toThrow/toThrowError

- included what was thrown for failure messages in toThrow and toThrowError
- fixed typo from 'execption' to 'exception' in toThrowError failure messages
- clarified failure messages in toThrowError to include specific error types

[Fixes #52680709]
This commit is contained in:
Sheel Choksi
2013-07-12 23:21:10 -07:00
parent 5b986c953c
commit c91df21a96
5 changed files with 57 additions and 49 deletions

View File

@@ -25,7 +25,7 @@ getJasmineRequireObj().toThrow = function(j$) {
if (arguments.length == 1) {
result.pass = true;
result.message = "Expected function not to throw.";
result.message = "Expected function not to throw, but it threw " + j$.pp(thrown) + ".";
return result;
}
@@ -34,7 +34,7 @@ getJasmineRequireObj().toThrow = function(j$) {
result.pass = true;
result.message = "Expected function not to throw " + j$.pp(expected) + ".";
} else {
result.message = "Expected function to throw " + j$.pp(expected) + ".";
result.message = "Expected function to throw " + j$.pp(expected) + ", but it threw " + j$.pp(thrown) + ".";
}
return result;