My method works the way I want it to, however, the test is failing when I add the pipe(skip(1))
How do I test an observable with a pipeable skip. Here is my method:
getSomething() {
this.store.pipe(select(selectSomeStatus))
.pipe(skip(1)) // TEST WILL PASS WHEN LINE REMOVED
.subscribe((data) => {
// TEST NOT GETTING HERE
});
}
Here is the test:
it('should getSomething', fakeAsync(() => {
// Arrange
const mockResult = [];
store.overrideSelector(selectSomeStatus, mockResult);
store.refreshState();
// Act
component.getSomething();
tick();
// Assert
// Assertions will go here
}));
I'm not sure what I am doing wrong. Any help would be much appreciated.