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: refactor to use assert pkg instead of t.Fatal #2880

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

alexandear
Copy link
Member

This PR refactors tests:

  • Replaces if err != nil { t.Fatal(err) } with assert.NilError(t, err) for consistency with other tests.
  • Extends the forbidigo rules to forbid using t.Fatal in tests.

Using t.Error is acceptable. Sometimes tests need to report failure and continue execution.

@alexandear alexandear force-pushed the test/refactor-to-use-assert branch 2 times, most recently from 268dbf9 to eff126a Compare November 8, 2024 12:04
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jandubois jandubois merged commit 784625e into lima-vm:master Nov 8, 2024
29 checks passed
@alexandear alexandear deleted the test/refactor-to-use-assert branch November 8, 2024 18:23
@AkihiroSuda AkihiroSuda added this to the v1.0.2 milestone Nov 9, 2024
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.

3 participants