Skip to content

Commit

Permalink
test: server timing on root and options method
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-chavez committed Nov 28, 2023
1 parent 558e9d4 commit b080f59
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion test/spec/Feature/Query/ServerTimingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec :: SpecWith ((), Application)
spec =
describe "Show Duration on Server-Timing header" $ do

context "responseonds with Server-Timing header" $ do
context "responds with Server-Timing header" $ do
it "works with get request" $ do
request methodGet "/organizations?id=eq.6"
[]
Expand Down Expand Up @@ -73,3 +73,39 @@ spec =
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "plan", "transaction", "response"]
}

it "works with root spec" $
request methodHead "/"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "plan", "transaction", "response"]
}

it "works with OPTIONS method" $ do
request methodOptions "/organizations"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "response"]
}
request methodOptions "/rpc/getallprojects"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "response"]
}
request methodOptions "/"
[]
""
`shouldRespondWith`
""
{ matchStatus = 200
, matchHeaders = map matchServerTimingHasTiming ["jwt", "parse", "response"]
}

0 comments on commit b080f59

Please sign in to comment.