Skip to content

Commit

Permalink
test(json): assert_str (#221)
Browse files Browse the repository at this point in the history
* test(json): assert_str

* build(json): also build on test for other tests

* build: allow dead code for tests
  • Loading branch information
EdJoPaTo authored Sep 19, 2024
1 parent 49e1d66 commit b926de0
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 215 deletions.
5 changes: 2 additions & 3 deletions src/client_reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl AsyncTelegramApi for AsyncApi {
mod async_tests {
use super::*;
use crate::api_params::SendMessageParams;
use crate::json;

#[tokio::test]
async fn async_send_message_success() {
Expand All @@ -165,9 +166,7 @@ mod async_tests {
let api = AsyncApi::new_url(server.url());

let response = api.send_message(&params).await.unwrap();

let json = serde_json::to_string(&response).unwrap();
assert_eq!(response_string, json);
json::assert_str(&response, response_string);
}

#[tokio::test]
Expand Down
Loading

0 comments on commit b926de0

Please sign in to comment.