Skip to content

Document the default behavior of require-error and fn-pattern #183

Closed Answered by Antonboom
ian-h-chamberlain asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

the user could override it by specifying configuration

exactly so

and the regex only serves to filter them down further

this is right too

in other words – require-error marks any error assertions (how README said), but you could select the specific assertions by fn-pattern

example here:

    require-error:
      # Regexp for assertions to analyze. If defined then only matched assertions will be reported.
      # Default: ""
      fn-pattern: ^(Errorf?|NoErrorf?)$

^ it means require will be required (sorry for tautology 🙂) only for

assert.NoError(t, err)
assert.NoErrorf(t, err, "msg")
assert.Error(t, err)
assert.Errorf(t, err, "msg")

other errors assertions (from hardcoded list) wil…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Antonboom
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
documentation Improvements or additions to documentation question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #44 on October 03, 2024 06:32.