Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Karma / jasmine-marbles: test failure message not properly formatted

I have added jasmine-marbles to my project and I am getting error messages like this:

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

instead of something like this:

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

Test:

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);
});

package.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",
   ...

How to fix the test failure message? Is it related to some karma reporter / plugin / missing library?

like image 631
Felix Avatar asked Oct 28 '22 23:10

Felix


1 Answers

See package.json,

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

I don't know if it makes a difference.

like image 177
Richard Matsen Avatar answered Dec 14 '22 23:12

Richard Matsen