Merge branch 'update-throwError-to-throw-objects' of https://github.com/terencehonles/jasmine

* Merges #1822 from @terencehonles
This commit is contained in:
Steve Gravrock
2020-06-26 14:59:29 -07:00
3 changed files with 17 additions and 5 deletions

View File

@@ -8214,10 +8214,10 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
* @name SpyStrategy#throwError
* @since 2.0.0
* @function
* @param {Error|String} something Thing to throw
* @param {Error|Object|String} something Thing to throw
*/
SpyStrategy.prototype.throwError = function(something) {
var error = something instanceof Error ? something : new Error(something);
var error = j$.isString_(something) ? new Error(something) : something;
this.plan = function() {
throw error;
};