Address review fixes.

This commit is contained in:
Dillon Kearns 2021-06-03 17:14:25 -07:00
parent 7ce56bcb1a
commit ee874f3ba0
5 changed files with 9 additions and 13 deletions

View File

@ -159,7 +159,7 @@ type alias Response =
{-| -}
succeed : a -> Handler a (List String)
succeed a =
Handler "" (\args -> a) (\_ -> "") (\list -> list)
Handler "" (\_ -> a) (\_ -> "") (\list -> list)
{-| -}

View File

@ -127,7 +127,7 @@ This will directly call the raw `elm/json` decoder that is stored under the hood
-}
decodeValue : Decoder a -> Value -> Result Error a
decodeValue (OptimizedDecoder jd jde) =
decodeValue (OptimizedDecoder jd _) =
JD.decodeValue jd

View File

@ -74,7 +74,7 @@ all =
[ test "multi-level routes" <|
\() ->
succeed
(\userName repoName ->
(\_ _ ->
{ body = "Data for user" }
)
|> literal "repos"

View File

@ -268,7 +268,7 @@ expectAll :
expectAll expectedPairs glob =
expectedPairs
|> List.map
(\( filePath, expectedMatch ) ->
(\( filePath, _ ) ->
( filePath
, glob
|> DataSource.Internal.Glob.run filePath

View File

@ -667,7 +667,7 @@ TODO
, describe "staticHttpCache"
[ test "it doesn't perform http requests that are provided in the http cache flag" <|
\() ->
startWithHttpCache (Ok ())
startWithHttpCache
[ ( { url = "https://api.github.com/repos/dillonkearns/elm-pages"
, method = "GET"
, headers = []
@ -690,7 +690,7 @@ TODO
]
, test "it ignores unused cache" <|
\() ->
startWithHttpCache (Ok ())
startWithHttpCache
[ ( { url = "https://this-is-never-used.example.com/"
, method = "GET"
, headers = []
@ -733,7 +733,6 @@ TODO
|> ApiRoute.literal "test.txt"
|> ApiRoute.singleRoute
]
(Ok ())
[]
[]
|> ProgramTest.simulateHttpOk
@ -766,7 +765,6 @@ TODO
|> ApiRoute.literal "test.txt"
|> ApiRoute.singleRoute
]
(Ok ())
[ ( { url = "https://api.github.com/repos/dillonkearns/elm-pages"
, method = "GET"
, headers = []
@ -812,12 +810,11 @@ type Route
start : List ( List String, DataSource.DataSource a ) -> ProgramTest (Model Route) Msg Effect
start pages =
startWithHttpCache (Ok ()) [] pages
startWithHttpCache [] pages
startWithHttpCache :
Result String ()
-> List ( Request.Request, String )
List ( Request.Request, String )
-> List ( List String, DataSource.DataSource a )
-> ProgramTest (Model Route) Msg Effect
startWithHttpCache =
@ -826,11 +823,10 @@ startWithHttpCache =
startLowLevel :
List (ApiRoute.Done ApiRoute.Response)
-> Result String ()
-> List ( Request.Request, String )
-> List ( List String, DataSource.DataSource a )
-> ProgramTest (Model Route) Msg Effect
startLowLevel apiRoutes documentBodyResult staticHttpCache pages =
startLowLevel apiRoutes staticHttpCache pages =
let
contentCache =
ContentCache.init Nothing