DEV Community

Cover image for Use Grillon to test your Rust HTTP API! 0.5.0-alpha.1 is out!
theredfish for Owl Duty

Posted on • Edited on

Use Grillon to test your Rust HTTP API! 0.5.0-alpha.1 is out!

Hey Rustaceans!

Many of you develop or maintain HTTP APIs in Rust. But writing and maintaining their tests can be a tedious task right?

With the pre-release 0.5.0-alpha.1, you can preview the built-in functions to test json path values for equality and validity with a json schema. Your feedback is important so we can better shape what you need! Give it a try by following the instructions in the Readme.

⭐ Consider to give it a star to support the project! Thanks!

GitHub logo theredfish / grillon

πŸ¦— Grillon, an elegant and natural way to approach API testing in Rust.

Grillon

Crates.io docs.rs GitHub Workflow Status Check Links

Grillon offers an elegant and natural way to approach API testing in Rust.

  • Elegant, intuitive and expressive API
  • Built-in testing functions
  • Extensible

Please note that the API is subject to a lot of changes until the v1.0.0.

Documentation

Getting started

You need Tokio as asynchronous runtime. Generally, testing libs are used in unit or integration tests so let's declare grillon as a dev-dependency.

Add grillon to Cargo.toml

[dev-dependencies]
grillon = "0.5.0-alpha.1"
tokio = { version = "1", features = ["macros"] }
Enter fullscreen mode Exit fullscreen mode

Then use grillon :

use grillon::{dsl::*, dsl::http::*, json, Grillon, StatusCode, Result};
use grillon::header::{HeaderValue, CONTENT_LENGTH, CONTENT_TYPE};
#[tokio::test]
async
…
Enter fullscreen mode Exit fullscreen mode

Top comments (0)