Doc on how to write tests #555
-
Is there any doc on how to write tests with axum? I saw the example but it's not enough for a novice like me :) I was able to write simple route tests, but as soon as I try to write tests that access the database with sqlx, I am faced with "Future" errors that I can't solve. I looked at the API doc and here in the repo for some guidance/documentation, but beside this example I cannot find anything. Any tips on where to look? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
We don't have anything outside of that example as that requires documenting testing each and every individual library. What are the specific "future" issues you have? |
Beta Was this translation helpful? Give feedback.
-
Here is the modified app fn after I added the pgpool. I added "async" so that the pool would work. But this will give me an error for the line
|
Beta Was this translation helpful? Give feedback.
-
@kinwolfqc I'm aware that this issue is stale, but I created a lib based on TestClient (that is inside axum), it reduces most of the boilerplate for testing axum: remmember to add it inside dev-dependencies, instead of dependencies directly |
Beta Was this translation helpful? Give feedback.
Here is the modified app fn after I added the pgpool. I added "async" so that the pool would work. But this will give me an error for the line
.serve(app().into_make_service())