Skip to main content
added 3 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

Yes, proper dependency injection benefits testing and TDD greatly because it allows to test individual components/dependencies easier - mocking/stubing each of the dependencies without affecting any global variables or global dependencies which other parts of an application may depend upon or other tests might use.

I found it quite handy to write unit and integration tests for the AngularJS application - it was very convenient to simulate all sorts of test pre-conditions by just preparing your services or other components and then injectinjecting them into a component under test.

Yes, proper dependency injection benefits testing and TDD greatly because it allows to test individual components/dependencies easier - mocking/stubing each of the dependencies without affecting any global variables or global dependencies which other parts of an application may depend upon or other tests might use.

I found it quite handy to write unit and integration tests for the AngularJS application - it was very convenient to simulate all sorts of test pre-conditions by just preparing your services or other components and then inject them into a component under test.

Yes, proper dependency injection benefits testing and TDD greatly because it allows to test individual components/dependencies easier - mocking/stubing each of the dependencies without affecting any global variables or global dependencies which other parts of an application may depend upon or other tests might use.

I found it quite handy to write unit and integration tests for the AngularJS application - it was very convenient to simulate all sorts of test pre-conditions by just preparing your services or other components and then injecting them into a component under test.

Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

Yes, proper dependency injection benefits testing and TDD greatly because it allows to test individual components/dependencies easier - mocking/stubing each of the dependencies without affecting any global variables or global dependencies which other parts of an application may depend upon or other tests might use.

I found it quite handy to write unit and integration tests for the AngularJS application - it was very convenient to simulate all sorts of test pre-conditions by just preparing your services or other components and then inject them into a component under test.