Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  24] [ 3]  / answers: 1 / hits: 33559  / 12 Years ago, wed, november 7, 2012, 12:00:00

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


More From » angularjs

 Answers
-1

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:




  • Built-in dependency injection (DI) system makes it easy to combine an application from smaller, well tested elements

  • Accompanying tooling - Testacular - makes it easy to write and execute tests in practice



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: https://stackoverflow.com/a/13213262/1418796


[#82143] Tuesday, November 6, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
giovanny

Total Points: 314
Total Questions: 101
Total Answers: 90

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
;