Improve errors with the domaine and how to use the API

This commit is contained in:
dhoko
2016-01-20 15:49:47 +01:00
parent b6798cdb06
commit 14067d0785
16 changed files with 131 additions and 28 deletions

View File

@@ -1,5 +1,7 @@
getJasmineRequireObj().toThrow = function(j$) {
var getErrorMsg = j$.formatErrorMsg('<toThrow>', 'expect(function() {<expectation>}).toThrow()', 'You can match a specific exception with <toThrowError>');
function toThrow(util) {
return {
compare: function(actual, expected) {
@@ -8,7 +10,7 @@ getJasmineRequireObj().toThrow = function(j$) {
thrown;
if (typeof actual != 'function') {
throw new Error('Actual is not a Function');
throw new Error(getErrorMsg('Actual is not a Function'));
}
try {