Add test for unexpectedConfigurationErrorDetails

This commit is contained in:
Jeroen Engels 2022-06-22 22:25:21 +02:00
parent fae198f186
commit d90bfb46cb

View File

@ -19,6 +19,7 @@ all =
, underMismatchTest
, unexpectedDetailsTest
, unexpectedGlobalErrorDetailsTest
, unexpectedConfigurationErrorDetailsTest
, emptyDetailsTest
, wrongLocationTest
, underMayNotBeEmptyTest
@ -404,6 +405,38 @@ but I found these details:
`Some details`"""
unexpectedConfigurationErrorDetailsTest : Test
unexpectedConfigurationErrorDetailsTest =
test "unexpectedConfigurationErrorDetails" <|
\() ->
let
expectedDetails : List String
expectedDetails =
[ "Some details" ]
error : { message : String, details : List String }
error =
{ message = "Some error"
, details = [ "Some other details" ]
}
in
FailureMessage.unexpectedConfigurationErrorDetails expectedDetails error
|> expectMessageEqual """
\u{001B}[31m\u{001B}[1mUNEXPECTED CONFIGURATION ERROR DETAILS\u{001B}[22m\u{001B}[39m
I found a configuration error with the following message:
`Some error`
and I was expecting its details to be:
`Some other details`
but I found these details:
`Some details`"""
emptyDetailsTest : Test
emptyDetailsTest =
describe "emptyDetails"