mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-09 20:22:24 +03:00
Report error that says message is different
This commit is contained in:
parent
851be878a3
commit
538597177e
@ -1479,4 +1479,4 @@ expectConfigurationError expectedError reviewResult =
|
||||
|
||||
expectConfigurationErrorDetailsMatch : { message : String, details : List String } -> { message : String, details : List String } -> Expectation
|
||||
expectConfigurationErrorDetailsMatch expectedError configurationError =
|
||||
Expect.fail (FailureMessage.unexpectedConfigurationError configurationError)
|
||||
Expect.fail (FailureMessage.messageMismatchForConfigurationError expectedError configurationError)
|
||||
|
@ -4,7 +4,7 @@ module Review.Test.FailureMessage exposing
|
||||
, underMismatch, expectedMoreErrors, tooManyErrors, locationNotFound, underMayNotBeEmpty, locationIsAmbiguousInSourceCode
|
||||
, needToUsedExpectErrorsForModules, missingSources, duplicateModuleName, unknownModulesInExpectedErrors
|
||||
, missingFixes, unexpectedFixes, fixedCodeMismatch, unchangedSourceAfterFix, invalidSourceAfterFix, hasCollisionsInFixRanges
|
||||
, didNotExpectGlobalErrors, expectedMoreGlobalErrors, fixedCodeWhitespaceMismatch, messageMismatchForGlobalError, missingConfigurationError, tooManyGlobalErrors, unexpectedConfigurationError, unexpectedGlobalErrorDetails
|
||||
, didNotExpectGlobalErrors, expectedMoreGlobalErrors, fixedCodeWhitespaceMismatch, messageMismatchForConfigurationError, messageMismatchForGlobalError, missingConfigurationError, tooManyGlobalErrors, unexpectedConfigurationError, unexpectedGlobalErrorDetails
|
||||
)
|
||||
|
||||
{-| Failure messages for the `Review.Test` module.
|
||||
@ -134,6 +134,18 @@ but I found the following error message:
|
||||
""" ++ wrapInQuotes error.message)
|
||||
|
||||
|
||||
messageMismatchForConfigurationError : { a | message : String } -> { b | message : String } -> String
|
||||
messageMismatchForConfigurationError expectedError error =
|
||||
failureMessage "UNEXPECTED CONFIGURATION ERROR MESSAGE"
|
||||
("""I was looking for the configuration error with the following message:
|
||||
|
||||
""" ++ wrapInQuotes expectedError.message ++ """
|
||||
|
||||
but I found the following error message:
|
||||
|
||||
""" ++ wrapInQuotes error.message)
|
||||
|
||||
|
||||
underMismatch : ReviewError -> { under : String, codeAtLocation : String } -> String
|
||||
underMismatch error { under, codeAtLocation } =
|
||||
failureMessage "UNEXPECTED ERROR LOCATION"
|
||||
|
Loading…
Reference in New Issue
Block a user