【问题标题】:ngrx/effects unit tests using jasmine-marbles使用 jasmine-marbles 的 ngrx/effects 单元测试
【发布时间】:2018-05-15 19:57:24
【问题描述】:

当我尝试使用来自jasmine-marblescoldhot 函数时,我不断收到TypeError: Class constructor Observable cannot be invoked without 'new'。有人知道如何解决这个错误吗?这是我下面的内容。

   import { hot, cold } from "jasmine-marbles";
   import { Observable } from "rxjs/Observable";

   const myAction = hot("--a-", { a: "TEST" };

【问题讨论】:

  • 对我来说也一样。我也尝试将 jasmine-marbles 从 0.2.0 更新到 0.3.1,但出现了其他问题(因为我还没有更新到 rxjs 6)。
  • ...它似乎与目标es2015一起出现。

标签: testing ngrx ngrx-effects jasmine-marbles


【解决方案1】:

在将 tsconfig.json(在项目根目录)中的“target”属性更改为“es6”后,我开始收到此错误,因此我恢复为旧的“es5”

【讨论】:

    猜你喜欢
    • 2018-01-04
    • 2019-02-06
    • 2023-03-13
    • 2019-10-24
    • 1970-01-01
    • 2019-01-14
    • 2019-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多