I am trying to call .next
on a simple subject submitTask$
.
My pipeline is this:
export const submitTask$ = new Subject();
function epic() {
return submitTask$.pipe(
map(taskId => {
console.log('here');
return Boolean(taskId)
})
)
}
I am trying to use TestScheduler to test this but cannot figure out how. I tried this:
const testScheduler = new TestScheduler((actual, expected) => {
expect(actual).toStrictEqual(expected);
});
testScheduler.run(({ hot, expectObservable }) => {
const actions$ = hot('-', [() => submitTask$.next(task.id)]);
const output$ = epic();
expectObservable(output$).toBe('0', [true]);
However it is not working, I am never seeing the console.log('here')