Closed xileftenurb closed 4 years ago
Hi @xileftenurb, will you show examples of what the new output looks like compared to the old?
good point, here is some real example of a test I'm working on right now
Failed:
Expected :
{"frame":0,"notification":{"kind":"N","value":"
{}
","hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":"
{}
","hasValue":true}}
{"frame":16,"notification":{"kind":"N","value":"
{}
","hasValue":true}}
{"frame":20,"notification":{"kind":"N","value":"
{"sort":"-name"}
","hasValue":true}}
{"frame":23,"notification":{"kind":"N","value":"
{"sort":"name"}
","hasValue":true}}
to deep equal :
{"frame":0,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":"
{}
","hasValue":true}}
{"frame":16,"notification":{"kind":"N","value":"
{}
","hasValue":true}}
{"frame":20,"notification":{"kind":"N","value":"
{"sort":"-name"}
","hasValue":true}}
{"frame":23,"notification":{"kind":"N","value":"
{"sort":"name"}
","hasValue":true}}
Marble :
actual : 1---------1-----1---2--3
expected : 4---------1-----1---2--3
value :
{
1 : "{}"
2 : "{\"sort\":\"-name\"}"
3 : "{\"sort\":\"name\"}"
4 : "null"
}
with the new commit, the output look like this :
Failed:
Expected :
{"frame":5,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":5,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":5,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":5,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":22,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":22,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":22,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":22,"notification":{"kind":"N","value":null,"hasValue":true}}
to deep equal :
{"frame":5,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":10,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":18,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":22,"notification":{"kind":"N","value":null,"hasValue":true}}
{"frame":30,"notification":{"kind":"N","value":null,"hasValue":true}}
Marble :
actual : -----(1111)----(1111) 7ms ----(1111) 7ms -
expected : -----1 ----1 7ms 1---1 7ms 1
value :
{
1 : "null"
}
Also, the build fail because I added "2019" in the lib, and the config seem to not like that. Is it fixable? I could always add a polyfill for flatMap, but since we use typescript, that look silly to me.
@xileftenurb I pulled your changes, and after fixes needed to build it properly, I didn't see any difference between error reporting. How do You use this library? I use it like this:
expect(myObservable$).toBeObservable(cold('a', { a: true }));
It seems that it's implementation is defined here.
@krzysztof-grzybek I'm not very used to build system, I used it like this :
import {getTestScheduler} from "jasmines-marbles"
const scheduler = new getTestScheduler()
scheduler.run(helper => {
helper.expectObservable(myObservable$).toBe("a", {a : true});
})
@xileftenurb I see. I'm afraid it's not the usage which the library was designed for. Take a look here.
Closed by #55
Hi here,
I wanted a better error output, so I modified the matcher for my own use.
Feel free to pull my version if you want. the issues I fixed :