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(network/test): Reduce duplicated code #6

Open
Pantani opened this issue May 2, 2022 · 1 comment
Open

feat(network/test): Reduce duplicated code #6

Pantani opened this issue May 2, 2022 · 1 comment

Comments

@Pantani
Copy link
Collaborator

Pantani commented May 2, 2022

We can use more table tests in the network methods and avoid calling the queryMock too much time. We should define a structure to carry the expected mock and call only one time in the tests.

type mocks struct {
	coordByAddr profiletypes.QueryGetCoordinatorByAddressRequest
	createChain launchtypes.MsgCreateChain
	...
}

suite.ProfileQueryMock.
On(
	"CoordinatorByAddress",
	context.Background(),
	tt.mocks.coordByAddr,
).
Return(nil, nil).
Once()
@ivanovpetr
Copy link
Contributor

You mean adding fixtures inside of the suite struct? If so I like the idea👌

@salmad3 salmad3 transferred this issue from ignite/cli Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Discuss
Development

No branches or pull requests

2 participants