1

First of all my, my project consists of two parts: an API and a frontend.

My API is generated by the yeoman meanjs generator so it is built using the mean stack. The frontend is an angular project and generated using the yeoman angular generator.

When the login form on the angular project is filled in, an api call is made to the API backend which authenticates the user. In the same fashion, CRUD calls can be made so basically the backend of the project has been split into a different project consisting of only the API. The reason for this is that it is possible to create different applications (e.g. a mobile app) to use the same backend logic, therefore reducing work.

Now comes my real question: what would be the best way to test this type of design. For example, when testing the login form. I have to make a signin call to the API to authenticate myself. How would I test such a functionality?

Thank you

1 Answers1

0

You might want to check out a headless browser like PhantomJS for testing the form itself.

You can build test cases for your API using something like Mocha or expect. Mocha might have headless browsing functionality, but I'm not sure. If you just need to do a quick check that your API works I'd recommend just using Postman.

JeffLuppes
  • 169
  • 1
  • 13