mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-23 23:05:35 +03:00
Explain why we require providing the fix result in test error messages
This commit is contained in:
parent
3a05b37fd3
commit
5433526b2f
@ -246,9 +246,18 @@ I expected that the error with the following message
|
||||
|
||||
would not have any fixes, but it provided some.
|
||||
|
||||
Hint: You may have forgotten to call `Lint.Test.whenFixed`
|
||||
It's probable that you either forgot to call `Rule.withFixes` on the
|
||||
error that you created, or that the list of provided fixes was empty."""
|
||||
Because the error provides fixes, I require providing the expected result
|
||||
of the automatic fix. Otherwise, there is no way to know whether the fix
|
||||
will result in a correct and in the intended result.
|
||||
|
||||
To fix this, you can call `Lint.Test.whenFixed` on your error:
|
||||
|
||||
Lint.Test.error
|
||||
{ message = "<message>"
|
||||
, details = "<details>"
|
||||
, under = "<under>"
|
||||
}
|
||||
|> Lint.Test.whenFixed "<source code>\""""
|
||||
|
||||
|
||||
fixedCodeMismatch : SourceCode -> SourceCode -> Error -> String
|
||||
|
@ -641,9 +641,19 @@ I expected that the error with the following message
|
||||
|
||||
would not have any fixes, but it provided some.
|
||||
|
||||
Hint: You may have forgotten to call `Lint.Test.whenFixed`
|
||||
It's probable that you either forgot to call `Rule.withFixes` on the
|
||||
error that you created, or that the list of provided fixes was empty."""
|
||||
Because the error provides fixes, I require providing the expected result
|
||||
of the automatic fix. Otherwise, there is no way to know whether the fix
|
||||
will result in a correct and in the intended result.
|
||||
|
||||
To fix this, you can call `Lint.Test.whenFixed` on your error:
|
||||
|
||||
Lint.Test.error
|
||||
{ message = "<message>"
|
||||
, details = "<details>"
|
||||
, under = "<under>"
|
||||
}
|
||||
|> Lint.Test.whenFixed "<source code>"
|
||||
"""
|
||||
|
||||
|
||||
fixedCodeMismatchTest : Test
|
||||
|
Loading…
Reference in New Issue
Block a user