---
agentTools:
  projectIndex: https://laravel-angular.readme.io/llms.txt
---

# Angular tests

[ng-describe](https://github.com/kensho/ng-describe) is available out of the box, for you to write fluent tests for your angular app.

**ng-describe** makes it very easy to test **components**, **services**, **inject dependencies** and **mock ajax calls**.
You can browse the tests available for the **login** or **register** components.

[block:callout]
{
  "type": "info",
  "title": "Angular Generators",
  "body": "for **components**, **directives** and **services** automatically generate the ng-describe spec file. You would just need to implement the test cases."
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "ngDescribe({\n    name: 'Test forgot-password component',\n    modules: 'app',\n    inject: '$http',\n    element: '<forgot-password></forgot-password>',\n    http: {\n        post: {\n            '/api/auth/password/email': {\n                data: true\n            }\n        }\n    },\n    tests: function(deps) {\n\n        it('should request email verification successfully', () => {\n            var component = deps.element.isolateScope().vm;\n\n            component.email = 'email@localhost.com';\n            component.submit();\n\n            deps.http.flush();\n        });\n    }\n});\n",
      "language": "javascript",
      "name": "forgot_password.spec.js"
    }
  ]
}
[/block]