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

refactor(tests): assert.Error -> require.Error (other unit tests) #13399

Merged
merged 1 commit into from
Jul 28, 2024

Commits on Jul 27, 2024

  1. chore(tests): assert.Error->require.Error (other unit tests)

    This is part of a series of test tidies started by #13365.
    
    The aim is to enable the testifylint golangci-lint checker.
    
    This commit converts assert.Error checks into require.Error for the
    part of the codebase, as per #13270 (comment)
    
    In some places checks have been coaleced - in particular the pattern
    
    ```go
    if assert.Error() {
        assert.Contains(..., "message")
    }
    ```
    
    is now
    ```go
    require.ErrorContains(..., "message")
    ```
    
    Getting this wrong and missing the Contains is still valid go, so
    that's a mistake I may have made.
    
    Signed-off-by: Alan Clucas <alan@clucas.org>
    Joibel committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    86c259e View commit details
    Browse the repository at this point in the history