diff --git a/src/Lint/Test/ErrorMessage.elm b/src/Lint/Test/ErrorMessage.elm index d84575a7..088841cc 100644 --- a/src/Lint/Test/ErrorMessage.elm +++ b/src/Lint/Test/ErrorMessage.elm @@ -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 = "" + , details = "
" + , under = "" + } + |> Lint.Test.whenFixed "\"""" fixedCodeMismatch : SourceCode -> SourceCode -> Error -> String diff --git a/tests/ErrorMessageTest.elm b/tests/ErrorMessageTest.elm index 489a0f29..f39ea170 100644 --- a/tests/ErrorMessageTest.elm +++ b/tests/ErrorMessageTest.elm @@ -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 = "" + , details = "
" + , under = "" + } + |> Lint.Test.whenFixed "" +""" fixedCodeMismatchTest : Test