Throw an Error rather than a string when createSpyObj is called incorectly

This commit is contained in:
Steve Gravrock
2025-08-23 08:19:11 -07:00
parent 63774597f0
commit 8d99f27be8
3 changed files with 9 additions and 5 deletions

View File

@@ -54,7 +54,9 @@ getJasmineRequireObj().SpyFactory = function(j$) {
}
if (methods.length === 0 && properties.length === 0) {
throw 'createSpyObj requires a non-empty array or object of method names to create spies for';
throw new Error(
'createSpyObj requires a non-empty array or object of method names to create spies for'
);
}
return obj;