Karma测试TypeError:尝试使用Phantom JS 2.1.1分配给readonly属性

时间:2016-04-19 15:35:52

标签: angularjs phantomjs karma-jasmine

我们在TypeError: Attempted to assign to readonly property电话上面对httpBackend.flush()进行了Karma测试。

Phantom JS版 - 2.1.1。

Angular JS,Angular mocks version-1.2.26

以下是源代码:

    httpBackend.when('POST','/api/****/')
    .respond(200,response);

    spyOn(obj, 'event1');

    scope.requestMethod(mock);

    httpBackend.flush();
    expect(obj.event1).toHaveBeenCalled();

非常感谢有关此问题的任何指示。

0 个答案:

没有答案