I just went through the doc over there https://angular.io/guide/testing
component = fixture.debugElement.componentInstance
component = fixture.componentInstance
But I am yet to understand the difference between these two
There is no difference. TestBed.createComponent
creates an instance of component class, both properties refer to it:
fixture.debugElement.componentInstance === fixture.componentInstance
fixture.componentInstance
can be preferred because it takes less time to type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With