rxjs icon indicating copy to clipboard operation
rxjs copied to clipboard

Testing BehaviorSubject with RxJS Marble

Open wazio opened this issue 3 years ago • 0 comments

Describe the bug

I have an error testing BehaviorSubject using rxjs marbles.

Expected $.length = 1 to equal 2. Expected $[0].notification.value = 2 to equal 1.

Expected behavior

It shouldn't throw error.

Reproduction code

const scheduler = new TestScheduler((actual, expected) => expect(actual).toEqual(expected));
scheduler.run(({ expectObservable }) => {
    const response$ = new BehaviorSubject(1);
    expectObservable(response$).toBe('ab', { a: 1, b: 2 });
    response$.next(2);
});

Reproduction URL

No response

Version

7.5.6

Environment

No response

Additional context

No response

wazio avatar Aug 01 '22 11:08 wazio