I have a service like
export class TestService {
public props: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
props$ = this.props.asObservable();
test(){
}
}
and this is my .spect file of my component
let component: MainComponent;
let fixture: ComponentFixture<MainComponent>;
let testServiceSpy: jasmine.SpyObj<TestService>;
beforeEach(async(() => {
testServiceSpy = jasmine.createSpyObj<TestService>("TestService", [
"test",
],);
TestBed.configureTestingModule({
declarations: [ MainComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
imports:[HttpClientTestingModule],
providers:[
{
provide:TestService,
useValue:technicalFacilitiesServiceSpy,
},
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MainComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
and when I try to test in my .spect file like
testServiceSpy.props
I see undefined, how could I get the default value? false in this case