我在对以下方法进行单元测试时遇到问题:$scope.changeLocation=function(url){$location.path(url).search({ref:"outline"});};我编写了以下单元测试,但目前因出现此错误而失败(类型错误:无法读取未定义的属性“搜索”):var$locationMock={path:function(){},search:function(){}};it('changeLocationshouldupdatelocationcorrectly',function(){$controllerConstructor('CourseOut