@@ -16,7 +16,7 @@ assertForeignTrue value = do
1616 Assert.assert "Foreign value is boolean true" (eiBool == Right true)
1717
1818withBrowser :: forall a. (Browser -> Aff a) -> Aff a
19−withBrowser action = withResource acquire release action
19+withBrowser = withResource acquire release
2020 where
2121 acquire = launch chromium {}
2222 release = close
@@ -25,9 +25,13 @@ withBrowserPage :: forall a. URL -> (Page -> Aff a) -> Aff a
2525withBrowserPage url action = do
2626 withBrowser
2727 \browser -> do
28− page <- newPage browser {}
29− void $ goto page url {}
30− action page
28+ let
29+ acquire = newPage browser {}
30+ release = close
31+ withResource acquire release
32+ \page -> do
33+ void $ goto page url {}
34+ action page
3135
3236testClickEvent :: String -> (Page -> Selector -> {} -> Aff Unit) -> Page -> Aff Unit
3337testClickEvent event action page = do