Skip to content

Conversation

@cbrzn
Copy link
Contributor

@cbrzn cbrzn commented Apr 27, 2023

No description provided.

@cbrzn cbrzn requested a review from dOrgJelli as a code owner April 27, 2023 17:05
@cbrzn cbrzn requested a review from dOrgJelli May 30, 2023 16:48
}

#[test]
fn post_method() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use some form_data tests

mod get;
mod post;

pub fn get_client() -> PolywrapClient {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that we can now use the Rust client and don't have to rely on the JS client for rust wrappers.
Though, I think for most cases we could just mock the subinvocations(if any) and have unit tests instead of e2e


#[plugin_impl]
impl Module for HttpPlugin {
fn get(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general for wrappers (like we talked about on the call), I'd love to see more unit tests where we mock the deps (e.g. the subinvocations or in this case the network call).
This not only helps us test the code more thoroughly and without the client dep, but also I find it helps while developing.

@nerfZael nerfZael self-requested a review June 17, 2023 11:48
@cbrzn cbrzn merged commit 55968d3 into main Jun 17, 2023
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.

4 participants