O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit tests

These are the tests at the bottom of the test pyramid. These tests also deal with a single microservice, but unlike service tests, they don't focus on the entire microservice, nor do they work over HTTP. Unit tests interact with the parts/units of the microservice being tested directly or through in-memory calls. Testing in unit testing looks exactly like you are making real HTTP requests, except that you are dealing with mocks and playing with assertions. There are usually two kinds of unit testing involved: one that involves making database calls and another that involves playing directly with in-memory calls. A test can be termed a unit test if its scope is a very small piece of functionality, and if the test code and the production ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required