Marble: Frame changes in array

112 Views Asked by At

Update: Is it possible to manually add a frame after the observable emits a value and ends? The complete sign adds a frame.

I'm trying to implement a marble testing in my app and the test is:

const c$ = delete('1');
const expected = cold('a|', {a: {id: '1'}})
expect(c$).toBeObservable(expected);

Here my delete function is a mock for service's function and is basically

delete = service.deletePath = (id): Observable<any> => {
    return of({id});
};

My test fails as in my returned array, the frame changes for the second object.

Can someone please tell me why (ain't nothing but a headache))? See the difference

1

There are 1 best solutions below

0
On BEST ANSWER

Parentheses solved the problem.

'a|' was considered as two independent/different objects, each with its frame. With '(a|)' objects are both in one frame now.