angularjs - Angular unit test vs integration test -


i've started writing unit tests angular app i'm working on. there 1 thing i'm not sure , that's difference between unit test , integration test in context of angular.

assuming have controller test depends on (non angular) service, should create mock of service or try use real service when it's possible.

if inject service doesn't mean i'm creating integration test instead of unit test?

i'm asking because work colleagues keep writing tests inject real servicesand still call them unit tests. sucks big time when have debug errors injected services in tests , each service depends on 5 other services...

the purpose of unit test verify underlying unit's behavior in isolation environment , other units. essentially, if system under test, or test itself, interacts external systems, not real unit test.

a couple of months ago have written article topic. check out more information.


Comments

  1. In React, manipulating the actual DOM elements is rare. Remember that as a react js developer you have the JSX abstraction at our disposal. The native event object that you get with normal DOM manipulation in React is actually wrapped up in what’s called the SyntheticEvent. Make sure you can attach different types of events to HTML elements such as `onclicks`, `onchange`, `mouseenter`, etc.

    ReplyDelete

Post a Comment

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -