File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,19 @@ assertEq x y = if x == y
5151 then return unit
5252 else assertFail $ " Expected " <> show x <> " , got " <> show y
5353
54- -- | For helping type inference
54+ -- | For helping type inference
5555typeIs :: forall e a . a -> Assert e Unit
5656typeIs = const (return unit)
5757
5858main = runAff throwException (const $ log " affjax: All good!" ) $ do
5959 let ok200 = StatusCode 200
6060 let notFound404 = StatusCode 404
6161
62+ A .log " GET /does-not-exists: should be 404 Not found after retries"
63+ (attempt $ retry (Just 5000 ) affjax $ defaultRequest { url = " /does-not-exist" }) >>= assertRight >>= \res -> do
64+ typeIs (res :: AffjaxResponse String )
65+ assertEq notFound404 res.status
66+
6267 A .log " GET /mirror: should be 200 OK"
6368 (attempt $ affjax $ defaultRequest { url = " /mirror" }) >>= assertRight >>= \res -> do
6469 typeIs (res :: AffjaxResponse Foreign )
You can’t perform that action at this time.
0 commit comments