RxJS version: 5.0.0.beta.3
Code to reproduce:
let ts = new Rx.TestScheduler();
let expected = '--a--b--c--|';
let values = {
a: 0,
b: 2,
c: 44
}
let o = ts.createColdObservable('--a----b--c--|', values);
ts.expectObservable(o).toBe(expected, values);
ts.flush()
Expected behavior:
observables validation
Actual behavior:
failed with "this.assertDeepEqual is not a function"
Additional information:
I think the error is on the definition of assertDeepEqual used inside flush method.
When I try to replace your implementation importing assert module and using assert.deepEqual, the flush method was working correctly validating my observables
This is because currently testscheulder requires to inject deep equal assertion via ctor
constructor(public assertDeepEqual: (actual: any, expected: any) => boolean | void) {
and test case in RxJS fulfills it via its helper (test-helper). Have you tried to provide assertion via ctor? Does it not work still?
not tried yet but for which reason did you decide to inject the assertion?
not tried yet but for which reason did you decide to inject the assertion?
Because we can't assume what testing harness you're using, and each testing harness has a different means of deeply asserting two values to be equal.
FWIW: in the short term, you could use lodash's _.isEqual like:
new TestScheduler((a, b) => _.isEqual(a, b))
that should solve your issue.
I'm going to close this for now. Please reopen or open another issue if you continue to have a problem.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
FWIW: in the short term, you could use lodash's
_.isEquallike:new TestScheduler((a, b) => _.isEqual(a, b))that should solve your issue.
I'm going to close this for now. Please reopen or open another issue if you continue to have a problem.