April 2026
Intermediate
631 pages
16h 20m
English
You can use integration tests to verify that different units of code work together as expected. Unlike unit tests, which focus on testing individual modules or functions in isolation, integration tests aim to identify issues that may arise when these units interact with each other.
In contrast to unit tests, integration tests exist as files separate from the code file containing the library and should only test the public interface. More specifically, integration tests are stored in a top-level directory of the package called tests. Cargo knows how to look for integration tests inside this directory.
Let’s create a new package called integration_test, with the following command:
c:\> cargo new integration_test
Next, ...
Read now
Unlock full access