In AngularJS, why does introducing view logic (like jQuery) into controllers adversely affect testability?

I am new to Angular and coding from "testing". I understand that introducing view logic into controllers is not an "Angular Path", but it does not understand why this negatively affects testability.

+4
source share
2 answers

Because it relies on having a DOM for testing. You should be able to test the controller logic without creating a DOM, because you just have to mock the dependencies and then test the data in the constructed view model.

, - , , , , , , . , , .

, - , . , .

+4

, , unit test HTML. , - .

0

Source: https://habr.com/ru/post/1659664/


All Articles