11 Testing your Rust application

This chapter covers

  • Assessing the testing needs for our web service
  • Using Rust’s built-in testing capabilities to create unit tests
  • Setting up a conditional testing environment
  • Creating a mock server that we can remotely shut down
  • Using Warp’s built-in testing framework to test our filters
  • Writing integration tests against our running web service

This topic of this last chapter of the book is, for some developers, the most important aspect of writing applications: testing. You can practice test-driven development, where you write tests first. You can choose to write tests directly after having implemented the business logic, or can wait until a large part of the application logic is written before testing it. ...

Get Rust Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.