Allowed async functions to be passed into spy#callFake

This commit is contained in:
Julian Lannigan
2017-11-09 19:43:48 -05:00
parent 285f06d5c4
commit 2be5e0a962
3 changed files with 26 additions and 2 deletions

View File

@@ -88,7 +88,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
* @param {Function} fn The function to invoke with the passed parameters.
*/
this.callFake = function(fn) {
if(!j$.isFunction_(fn)) {
if(!(j$.isFunction_(fn) || j$.isAsyncFunction_(fn))) {
throw new Error('Argument passed to callFake should be a function, got ' + fn);
}
plan = fn;