Skip to content

Commit

Permalink
refactor: clean test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
n1k0 committed Sep 26, 2024
1 parent 694de1a commit 4a084ce
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/Server/ServerTest.elm
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,17 @@ suite =

request : StaticDb.Db -> String -> Encode.Value -> String -> Request
request dbs method body url =
let
encode encoder =
Encode.list encoder >> Encode.encode 0
in
{ method = method
, url = url
, body = body
, processes =
{ foodProcesses =
Encode.list FoodProcess.encode dbs.food.processes
|> Encode.encode 0
, objectProcesses =
Encode.list ObjectProcess.encode dbs.object.processes
|> Encode.encode 0
, textileProcesses =
Encode.list TextileProcess.encode dbs.textile.processes
|> Encode.encode 0
{ foodProcesses = dbs.food.processes |> encode FoodProcess.encode
, objectProcesses = dbs.object.processes |> encode ObjectProcess.encode
, textileProcesses = dbs.textile.processes |> encode TextileProcess.encode
}
, jsResponseHandler = Encode.null
}

0 comments on commit 4a084ce

Please sign in to comment.