As your application grows in features you want to make sure different flows work as expected. For isolated pieces of logic it’s very practical to use the built-in approach for tests in cargo.

In other cases you may encounter a more complex scenario, with different layers, from data input to database queries. You will expect a specific output given certain input.

The Project

Consider one of my very rencent projects Gabble, a chat solution you can host yourself.

Gabble has different layers of logic, every operation will be processed in each layer in the following order:

  1. GraphQL
  2. Services (Domain Logic)
  3. Database (PostgreSQL)