Hello everyone, 

In Angular documentation on the subject of testing a component with a 
dependency 
<https://angular.io/guide/testing#test-a-component-with-a-dependency>, the 
concrete class of the dependency is provided and a Stub is created, is it 
possible to mock the dependency so i don't have to import it?
You see, in my conception would be "better" to not depend on the 
dependency, in the component test, so i can test the component in isolation.
This implementation looks something like the ruby's rspec Verifying Doubles 
<https://relishapp.com/rspec/rspec-mocks/v/3-7/docs/verifying-doubles> i 
suppose, i see the advantages, but i wonder why the official angular 
documentation picked this implementation? 
Is using interfaces to create mocks 
<https://hackernoon.com/creating-interfaces-for-angular-services-1bb41fbbe47c> 
a 
valid approach? could i use it as an alternative? 

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to