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
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 expect
keyword) but those are not Jasmine tests. More info can be found here: http://stackoverflow.com/a/13213262/1418796
this is part of the test. it is described in https://docs.angularjs.org/guide/e2e-testing
Not all details are present, so you may want to look into the source code.