Raise an error when jasmine.any() isn't passed a constructor

This commit is contained in:
Dan Finnie
2015-05-17 02:21:26 -04:00
parent 0b1449228f
commit 302e78f1df
2 changed files with 13 additions and 0 deletions

View File

@@ -1,6 +1,12 @@
getJasmineRequireObj().Any = function(j$) {
function Any(expectedObject) {
if (typeof expectedObject === 'undefined') {
throw new TypeError(
'jasmine.any() expects to be passed a constructor function. ' +
'Please pass one or use jasmine.anything() to match any object.'
);
}
this.expectedObject = expectedObject;
}