Fix failing test.

This commit is contained in:
Dillon Kearns 2019-10-29 22:33:47 -07:00
parent e55f9069cc
commit e48c16da94
2 changed files with 13 additions and 8 deletions

View File

@ -624,6 +624,7 @@ sendStaticResponsesIfDone errors staticResponses manifest =
Err error -> Err error ->
{ message = { message =
[ Terminal.text path [ Terminal.text path
, Terminal.text "\n\n"
, Terminal.text error , Terminal.text error
] ]
} }
@ -653,7 +654,7 @@ sendStaticResponsesIfDone errors staticResponses manifest =
) )
else else
Errors <| errorsToString errors Errors <| errorsToString (failedRequests ++ errors)
) )
@ -690,21 +691,23 @@ errorToString : Error -> String
errorToString error = errorToString error =
case error of case error of
MissingSecret buildError -> MissingSecret buildError ->
banner "Missing Secret" :: buildError.message |> Terminal.toString banner "Missing Secret" ++ buildError.message |> Terminal.toString
MetadataDecodeError buildError -> MetadataDecodeError buildError ->
banner "Metadata Decode Error" :: buildError.message |> Terminal.toString banner "Metadata Decode Error" ++ buildError.message |> Terminal.toString
InternalError buildError -> InternalError buildError ->
banner "Internal Error" :: buildError.message |> Terminal.toString banner "Internal Error" ++ buildError.message |> Terminal.toString
FailedStaticHttpRequestError buildError -> FailedStaticHttpRequestError buildError ->
banner "Failed Static Http Error" :: buildError.message |> Terminal.toString banner "Failed Static Http Error" ++ buildError.message |> Terminal.toString
banner title = banner title =
Terminal.cyan <| [ Terminal.cyan <|
Terminal.text ("-- " ++ String.toUpper title ++ " ----------------------------------------------------- elm-pages\n\n") Terminal.text ("-- " ++ String.toUpper title ++ " ----------------------------------------------------- elm-pages")
, Terminal.text "\n\n"
]
encodeStaticResponses : StaticResponses -> Dict String (Dict String String) encodeStaticResponses : StaticResponses -> Dict String (Dict String String)

View File

@ -163,7 +163,9 @@ all =
(Codec.decoder Main.toJsCodec) (Codec.decoder Main.toJsCodec)
(Expect.equal (Expect.equal
[ Errors [ Errors
"""/elm-pages """\u{001B}[36m-- FAILED STATIC HTTP ERROR ----------------------------------------------------- elm-pages\u{001B}[0m
/elm-pages
Problem with the given value: Problem with the given value: