-
Book Overview & Buying
-
Table Of Contents
Rust Web Programming - Third Edition
By :
When it comes to unit testing, most good web frameworks will offer unit testing tools because the maintainers are skilled engineers, and they know the importance of unit testing. Actix is no exception. Unit testing our networking layer is a bit more complicated compared to our core because there are more moving parts. However, unit testing our network layer is a bit more representative of what unit testing is like outside of a toy example because we must handle multiple moving parts, and we must test how they work.
Before we write any testing code, however, we must reconfigure our dependencies with the following:
# nanoservices/to_do/networking/actix_server/
# Cargo.toml
. . .
[dependencies]
. . .
to-do-core = { path = "../../core" }
. . .
[dev-dependencies]
serde_json = "1.0.120"
actix-http = "3.8.0"
. . .
We can see that we add the serde-json and actix-http crates into dev-dependencies. We will use these...