ChainSafe / ChainSafe/gossamer

tests: review usage of mocks accepting anything

Open
#2,343 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Task summary

We should expect specific arguments for our mocks calls when the relevant code is being called within the code we are testing.

The following keywords should be reviewed and changed to a specific argument:

- `gomock.Any()`
- `gomock.AssignableToTypeOf(`

This affects most packages so it's hard to split by package really, maybe we can work keyword by keyword.

This problem might not apply to some integration tests where it is *fine* to accept anything as argument for mocks if it's for example telemetry calls when running tests for the state for example. Although that also highlights we don't have enough abstraction and interfaces in our code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.