xmtp / didethresolver

XMTP Registry Resolver
MIT License
3 stars 1 forks source link

eliminate warning for unused method during testing #19

Closed tsachiherman closed 9 months ago

tsachiherman commented 9 months ago

What's the problem ?

Running cargo test generated the following warning:

warning: static `INIT` is never used
 --> tests/integration_util/mod.rs:6:8
  |
6 | static INIT: Once = Once::new();
  |        ^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function `init_logging` is never used
 --> tests/integration_util/mod.rs:8:15
  |
8 | pub(crate) fn init_logging() {
  |               ^^^^^^^^^^^^

warning: `didethresolver` (test "integration_test") generated 2 warnings

Why does that happen ?

We currently have no integration tests implemented. In fact, we have a single stub called test_resolve_did that have a single like of code :

todo!()

As a result of that, the init_logging and the INIT aren't being used.

Solution

Modify the test_resolve_did() implementation, and add a call to init_logging. This would eliminate the warning, as the method would be called.

codecov-commenter commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ed3cedb) 91.37% compared to head (9caa4e8) 91.37%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #19 +/- ## ======================================= Coverage 91.37% 91.37% ======================================= Files 5 5 Lines 58 58 ======================================= Hits 53 53 Misses 5 5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.