mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 06:54:03 +03:00
Address review fixes.
This commit is contained in:
parent
7ce56bcb1a
commit
ee874f3ba0
@ -159,7 +159,7 @@ type alias Response =
|
||||
{-| -}
|
||||
succeed : a -> Handler a (List String)
|
||||
succeed a =
|
||||
Handler "" (\args -> a) (\_ -> "") (\list -> list)
|
||||
Handler "" (\_ -> a) (\_ -> "") (\list -> list)
|
||||
|
||||
|
||||
{-| -}
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -74,7 +74,7 @@ all =
|
||||
[ test "multi-level routes" <|
|
||||
\() ->
|
||||
succeed
|
||||
(\userName repoName ->
|
||||
(\_ _ ->
|
||||
{ body = "Data for user" }
|
||||
)
|
||||
|> literal "repos"
|
||||
|
@ -268,7 +268,7 @@ expectAll :
|
||||
expectAll expectedPairs glob =
|
||||
expectedPairs
|
||||
|> List.map
|
||||
(\( filePath, expectedMatch ) ->
|
||||
(\( filePath, _ ) ->
|
||||
( filePath
|
||||
, glob
|
||||
|> DataSource.Internal.Glob.run filePath
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user