In the Angular documentation they write this:
expect(scope.counter).toEqual(0);
and this was written in many places like here.
I just want to know what it does
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is Jasmine unit testing framework syntax for unit tests. Angular uses, promotes and encourages unit testing practices.
Testability is taken very seriously in AngularJS and the authors of the framework make sure that code written using AngularJS is easy to test:
AngularJS has also a solution for higher-level, end-to-end testing. E2e tests use a very similar syntax (so you will also notice the
expectkeyword) but those are not Jasmine tests. More info can be found here: https://stackoverflow.com/a/13213262/1418796