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

chore: refactor test assertions to be more idiomatic #5963

Open
wants to merge 1 commit into
base: mainline
Choose a base branch
from

Conversation

alexandear
Copy link

@alexandear alexandear commented Oct 30, 2024

The PR refactors test assertions to be more idiomatic:

  • Replace require.NotNil(t, err) with require.Error(t, err).
  • Replace require.Equal(t, nil, err) with require.NoError(t, err).
  • Replace require.Nil(t, err) with require.NoError(t, err).

Additionally, the PR enables testifylint to suggest these fixes in the future.

testifylint is present in golangci-lint starting from version v1.55. Therefore, this PR updates the golangci-lint version to the latest v1.60 in the ci.yml and disables a few lint issues not related to the topic. These issues will be fixed later.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.

@alexandear alexandear requested a review from a team as a code owner October 30, 2024 20:56
@alexandear alexandear requested review from iamhopaul123 and removed request for a team October 30, 2024 20:56
@alexandear alexandear changed the title chore: refactor test asserts chore: refactor test assertions to be more idiomatic Oct 30, 2024
@alexandear alexandear force-pushed the chore/refactor-test-asserts branch 2 times, most recently from 7b17027 to 7ef9f3f Compare October 30, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant