jasmine.spy类型的值上不存在属性andCallThrough()

jasmine.spy类型的值上不存在属性andCallThrough(),jasmine,karma-jasmine,Jasmine,Karma Jasmine,我有一段模拟服务的代码,但我得到了错误 如上所述。有没有人遇到过同样的问题?有没有修复方法?检查您正在使用的Jasmine版本 Jasmine 1.3中使用了.andCallThrough(),您应该在Jasmine 2.x中使用和.callThrough(),检查您正在使用的Jasmine版本 和.callThrough()在Jasmine 1.3中使用,您应该在Jasmine 2.x中使用和.callThrough() it('should call getCompany on th

我有一段模拟服务的代码,但我得到了错误
如上所述。有没有人遇到过同样的问题?有没有修复方法?

检查您正在使用的Jasmine版本


Jasmine 1.3中使用了
.andCallThrough()
,您应该在Jasmine 2.x中使用
和.callThrough()
,检查您正在使用的Jasmine版本

和.callThrough()
在Jasmine 1.3中使用,您应该在Jasmine 2.x中使用
和.callThrough()

    it('should call getCompany on the people service when getCompany is called',

        function () {
            spyOn(peopleService, 'requestPeople').andCallThrough();

            scope.getCompany();

            deferred.resolve();

            scope.$root.$digest();

            expect(peopleService.requestPeople).toHaveBeenCalled();
        });

    it('should populate the peopleList when getCompany is called',

        function () {
            scope.getCompany();

            deferred.resolve();

            scope.$root.$digest();

            expect(scope.peopleList).not.toBe([]);
        });