- How to build modularized and decoupled applications
- How to integrate with NoSQL database using MongoDB
- How to test Javascript applications with Test-driven-development
- Why testing facilitates development
- How to design APIs following the REST standard
- How to provide API authentication and security
I will test from the outside in, that is, we will start with integration tests and move on to unit tests
Mocha: the model that will runner test suites. Chai and sinon: the models that will be used to make assertions. Supertest: the model that will be used to emulate and abstract http request.
We will create routes an http req and res guided by integration tests, so it will be possible to validate the behavior.
In this case we will need supertest do make fake http request defined in mocha.config in integratio directory
-
We will create controllers guided by unit tests, so it will be possible to validate the behavior separately from our system itself.
-
we will use sinonjs to create spies, stubs e mocks, which will allow you to isolate the unit test