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
51
51
then return unit
52
52
else assertFail $ " Expected " <> show x <> " , got " <> show y
53
53
54
- -- | For helping type inference
54
+ -- | For helping type inference
55
55
typeIs :: forall e a . a -> Assert e Unit
56
56
typeIs = const (return unit)
57
57
58
58
main = runAff throwException (const $ log " affjax: All good!" ) $ do
59
59
let ok200 = StatusCode 200
60
60
let notFound404 = StatusCode 404
61
61
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
+
62
67
A .log " GET /mirror: should be 200 OK"
63
68
(attempt $ affjax $ defaultRequest { url = " /mirror" }) >>= assertRight >>= \res -> do
64
69
typeIs (res :: AffjaxResponse Foreign )
You can’t perform that action at this time.
0 commit comments