5

我已将jasmine-marbles添加到我的项目中,并且收到如下错误消息:

Expected $[0].frame = 20 to equal 70.
Expected $[0].notification.kind = 'E' to equal 'N'.
Expected $[0].notification.value = undefined to equal LoadSuccess().

而不是这样的:

Expected 
    {"frame":50,"notification":{"kind":"N","value":{"payload":"[
...
to deep equal 
    {"frame":40,"notification":{"kind":"N","value":{"payload":"[
...

测试:

it('should loadData$', () => {
    const action = new LoadRequest('123');
    const completion = new LoadSuccess({});

    actions$.stream = hot('-a', { a: action });
    const response = cold('-a|', { a: {} });
    const expected = cold('---c', { c: completion });

    client.loadData = () => response;

    expect(effects.loadData$).toBeObservable(expected);
});

包.json:

"devDependencies": {
    "jasmine-core": "^2.3.4",
    "jasmine-marbles": "^0.2.0",
    "jasmine-spec-reporter": "^3.2.0",
    "karma": "1.4.1",
    "karma-chrome-launcher": "^2.0.0",
    "karma-coverage": "^1.0.0",
    "karma-jasmine": "^1.1.0",
    "karma-mocha-reporter": "^2.2.5",
    "karma-remap-istanbul": "0.2.1",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-webpack": "2.0.2",
   ...

如何修复测试失败消息?它与一些业力报告者/插件/缺少的库有关吗?

4

1 回答 1

2

package.json

"jasmine": "^2.5.3",
"jasmine-core": "~2.5.2",

我不知道这是否有区别。

于 2017-11-13T08:23:53.947 回答