-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add testing #237
Comments
I could add tests for each function in the Client Impl. Would it be better in the same file or a separate folder? |
if we are just adding unit tests, then I'd just suggest a new tests module in the same file. although this file is getting kind of long already so I'd imagine even putting them in a separate file just for manageability that all being said, I think the type of tests that would be ideal would be more like an integration test -- and rust has idioms for this: https://doc.rust-lang.org/rust-by-example/testing/integration_testing.html if we did write an integration test for this, we would need to mock out a beacon node and also the HTTP functionality of the client -- both relatively large tasks on their own -- happy to work w/ you on the next steps here if you are interested |
Large tasks just mean I have more things to practice rust with, so I'm interested. I'm not familiar with integration tests in rust yet, so I'll go research and experiment with them. I would appreciate it if you could highlight the steps we would need to take next to complete this task. |
ok great! there are a couple routes here and I think the simplest may be to use something like https://docs.rs/httpmock/latest/httpmock/ to mock out the beacon API server |
Ideally there would be static test vectors that replicate the request/response cycle of a consumer/provider of this API but we don't really have anything like that right now
It would be very nice to add some kind of automatic testing though to make sure things are all good...
The text was updated successfully, but these errors were encountered: