简体   繁体   中英

Marble: Frame changes in array

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM