You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the examples in the examples folder I see that many don't come with tests.
Having tests with the examples will both help make sure that they stay correct as axum changes and it will help the would be developers to learn how to test.
As I see many of the examples have
asyncfnmain(){
...let app = Router::new()
...
}
This, as far as I understand, makes it impossible to use the router in the tests. So I think it would be a good idea to refactor these examples to defined a function
fnapp() -> Router{}
and then write
asyncfnmain(){
...
let app:Router = app();
...}
I'd be happy to do this work for some of the examples, but I'd like to know if you even consider this a good idea.
The text was updated successfully, but these errors were encountered:
szabgab
added a commit
to szabgab/axum
that referenced
this issue
Mar 12, 2025
Looking at the examples in the
examples
folder I see that many don't come with tests.Having tests with the examples will both help make sure that they stay correct as axum changes and it will help the would be developers to learn how to test.
As I see many of the examples have
This, as far as I understand, makes it impossible to use the router in the tests. So I think it would be a good idea to refactor these examples to defined a function
and then write
I'd be happy to do this work for some of the examples, but I'd like to know if you even consider this a good idea.
The text was updated successfully, but these errors were encountered: