带window.loocation的角度单元测试函数

时间:2017-11-25 14:06:10

标签: angular unit-testing karma-runner

我的服务有这样的功能:

public logout(): any {
    this._cookie.removeAll(this.cookieOption);
    return window.location.href = '/';
}

我面临的问题是,当我运行测试时,它永远无法正常运行,因为当我调用此函数时,浏览器会一直刷新并重新运行所有测试。

我该如何解决这个问题?

0 个答案:

没有答案
相关问题