Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose test client under testing feature #2699

Closed
wants to merge 2 commits into from

Conversation

tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Apr 6, 2024

Motivation

There is a crate axum-test-helper for the same purpose and it seems widely used. Since the crate is less actively maintained, I suppose we can implement the same on the upstream so keep it updated.

Solution

#[cfg(any(test, feature = "testing"))]
pub mod test_helpers;

... and export all inner methods for test clients.

@jplatte

@tisonkun tisonkun force-pushed the testing branch 2 times, most recently from 1b0ccd0 to 3ed2f79 Compare April 6, 2024 02:22
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 6, 2024

Some compile errors happen. I may spend more time investigating, while the "expected outer doc comment" seems a false-positive.

Anyway, I'd like to hear from the maintainer whether this is a good way to go first.

@jplatte
Copy link
Member

jplatte commented Apr 7, 2024

This was previously rejected in #1146, sorry.

@jplatte jplatte closed this Apr 7, 2024
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

Thanks for your information!

I just noticed that it's a thin wrapper of reqwest client so that I should be able to bundle it in my software :D

@tisonkun tisonkun deleted the testing branch April 8, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants