what is the "expect" function used in angular js

Here is the documentation for expect.


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


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.