In this tutorial, we will do basic testing of an AngularJS controller from scratch. By scratch, I mean, I will install all the software necessary.
We will use Karma as the test runner. It will read test suites defined using the Jasmine API and run them in your browser of choice.
The post() method of $http AngularJS service uses JSON form submission. That means, a JSON document is sent as the request body. You will need a REST web service to process the request. Most traditional web based handlers like Servlet or Struts action won’t be able to process it. In this article we will explore the issue and suggest a simple solution.