The RxJS Observer fires the events:
completeerrornext
If we want to test for the complete event with Jest. How is this done?
For example we can test the next and error events, because those functions pass data:
o.subscribe(result => {
expect(result.data.length).toEqual(1);
},
(e)=>{expect(e).toBeFalsy()},
()=>{ WHAT TO EXPECT HERE? }
The complete event does not. The function signature is ()=>void. How do we test that function signature?
Also the line (e)=>{expect(e).toBeFalsy()} because it never actually fires. Is there a way to check that a callback does not run?