What does the “it” function do in this code?

后端 未结 2 1326
一个人的身影
一个人的身影 2021-01-31 14:35

I\'m hoping somebody could explain to me what \"it\" does (is used for) in AngularJS or just plain JavaScript (I\'m not sure if it\'s specific to Angular). This, turns out, is a

2条回答
  •  野的像风
    2021-01-31 15:16

    So 'it' is referring to when you're testing your application, and only when you're testing. The point of testing is that you can have the test runner automate a bunch of the regular tasks your users would normally do then validate all the responses/events from those tasks work correctly. What your code is saying is that your test 'should check ng-show/ng-hide' and validate that they're working properly. You'll only see 'it' used in test runner like Karma or Jasmine.

提交回复
热议问题