mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Make failure message on unexpected extract helpful
This commit is contained in:
parent
83f51e00ad
commit
e1766bad01
@ -1576,8 +1576,8 @@ expectConfigurationErrorDetailsMatch expectedError configurationError =
|
||||
expectNoDataExtract : ExtractResult -> Expectation
|
||||
expectNoDataExtract maybeExtract =
|
||||
case maybeExtract of
|
||||
Just _ ->
|
||||
Expect.fail FailureMessage.needToUsedExpectErrorsForModules
|
||||
Just extract ->
|
||||
Expect.fail (FailureMessage.unexpectedExtract extract)
|
||||
|
||||
Nothing ->
|
||||
Expect.pass
|
||||
|
@ -653,9 +653,11 @@ but I could not find it.""")
|
||||
unexpectedExtract : Encode.Value -> String
|
||||
unexpectedExtract value =
|
||||
failureMessage "UNEXPECTED EXTRACT"
|
||||
("""This rule returned an extract which I did not expect.
|
||||
("""This rule returned an extract but I did not expect one.
|
||||
|
||||
You should use `REPLACEME` to assert that the extract fits what you had.
|
||||
You should use `Review.Test.expectDataExtract` or
|
||||
`Review.Test.expect`+`Review.Test.dataExtract` to assert that the extract
|
||||
fits what you expected.
|
||||
|
||||
""" ++ formatJson value)
|
||||
|
||||
|
@ -1180,9 +1180,11 @@ unexpectedExtractTest =
|
||||
|> expectMessageEqual """
|
||||
\u{001B}[31m\u{001B}[1mUNEXPECTED EXTRACT\u{001B}[22m\u{001B}[39m
|
||||
|
||||
This rule returned an extract which I did not expect.
|
||||
This rule returned an extract but I did not expect one.
|
||||
|
||||
You should use `REPLACEME` to assert that the extract fits what you had.
|
||||
You should use `Review.Test.expectDataExtract` or
|
||||
`Review.Test.expect`+`Review.Test.dataExtract` to assert that the extract
|
||||
fits what you expected.
|
||||
|
||||
{
|
||||
"foo": "bar",
|
||||
|
Loading…
Reference in New Issue
Block a user