Unable to Cover Test Case with both debounce and takeUntil,filter Angular
filter(item=>!item)
means that it will only passtrought FALSY values (null
,undefined
,false
,""
). What you want is the other way around - pass only truthy values
filter(item=>item)
or filter(item=>!!item)
After OP editing question:
Swap detectChanges
and tick
it should be
fixture.detectChanges(); //kicks in ngOnInit
tick(2000); // simulates passage of time