kwonoj/rx-sandbox

Pass in TestMessage as items when using an array for the 'e' function

xylude opened this issue · 1 comments

It would be pretty useful to be able to pass in TestMessage as items in an array to the 'e' function. It could allow developers to supply a frame number and skip having to add marble strings to put the expected message on the correct frame. It would also be useful to be able to use the same function to generate the expected messages and the messages coming out of hot/cold observables.

e is just a wrapper to create array of test message from marble string to assert with testmessage generated from hot / cold observable.

type expectedObservable = <T = string>(
marble: string,
value?: { [key: string]: T } | null,
error?: any
) => Readonly<Array<TestMessage<T | Array<TestMessage<T>>>>>;

If you already have test message values, then you can just directly assert it, does not need to use e at all.

It would also be useful to be able to use the same function to generate the expected messages and the messages coming out of hot/cold observables.

That's what e does now.