mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-26 05:13:24 +03:00
Add another test case.
This commit is contained in:
parent
0d3b918048
commit
fad924d28d
@ -135,6 +135,32 @@ all =
|
|||||||
]
|
]
|
||||||
Pattern.NoPendingSlash
|
Pattern.NoPendingSlash
|
||||||
)
|
)
|
||||||
|
, test "hybrid route with multiple static segments" <|
|
||||||
|
\() ->
|
||||||
|
succeed
|
||||||
|
(\repo ->
|
||||||
|
DataSource.succeed ("Data for repo " ++ repo |> ServerResponse.stringBody)
|
||||||
|
)
|
||||||
|
|> ApiRoute.literal "api"
|
||||||
|
|> ApiRoute.slash
|
||||||
|
|> ApiRoute.literal "repo"
|
||||||
|
|> ApiRoute.slash
|
||||||
|
|> ApiRoute.capture
|
||||||
|
|> ApiRoute.literal ".json"
|
||||||
|
|> serverless
|
||||||
|
|> Internal.ApiRoute.toPattern
|
||||||
|
|> Expect.equal
|
||||||
|
(Pattern
|
||||||
|
[ Pattern.Literal "api"
|
||||||
|
, Pattern.Literal "repo"
|
||||||
|
, Pattern.HybridSegment
|
||||||
|
( Pattern.Dynamic
|
||||||
|
, Pattern.Literal ".json"
|
||||||
|
, []
|
||||||
|
)
|
||||||
|
]
|
||||||
|
Pattern.NoPendingSlash
|
||||||
|
)
|
||||||
]
|
]
|
||||||
, describe "multi-part"
|
, describe "multi-part"
|
||||||
[ test "multi-level routes" <|
|
[ test "multi-level routes" <|
|
||||||
|
Loading…
Reference in New Issue
Block a user