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

test/devux: helper function for assertions conditional on error #1946

Closed
p0mvn opened this issue Jul 1, 2022 · 2 comments · Fixed by #1964
Closed

test/devux: helper function for assertions conditional on error #1946

p0mvn opened this issue Jul 1, 2022 · 2 comments · Fixed by #1964

Comments

@p0mvn
Copy link
Member

p0mvn commented Jul 1, 2022

Background

We tend to use a common pattern for asserting on the results in table-driven tests:

err := systemUnderTest(...)

if tc.expectedErr {
    require.Error(t, err)
    return
}

require.NoError(t, err)

We should make a helper for this pattern. e.g. osmoutils.ConditionalPanics(suite, expPanic, func)

Originally posted by @ValarDragon in #1872 (comment)

Acceptance Criteria

  • helper is created
  • skim our tests and replace / refactor to use the helper where applicable
@stackman27
Copy link
Contributor

Hi @p0mvn I can work on this!

@p0mvn
Copy link
Member Author

p0mvn commented Jul 2, 2022

Awesome, thank you

Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants