jeudi 28 janvier 2016

Angular unit test vs integration test

I've recently started writing unit tests for angular app I'm working on. There is one thing that I'm not sure about and that's a difference between unit test and integration test in context of Angular.

Assuming that I have a controller to test which depends on another (non angular) service, should I create a mock of a service or try to use real service when it's possible.

If I inject the service itself doesn't that mean I'm creating an integration test instead of a unit test?

I'm asking about that because my work colleagues keep writing tests that inject real servicesand still call them unit tests. It sucks big time especially when you have to debug errors from injected services in tests and each service depends on 5 other services...

Aucun commentaire:

Enregistrer un commentaire