Tasty has only the function withResource to manage resources in your tests.
The function takes a resource initialization and cleanup function as arguments:
withResource :: IO a -> (a -> IO ()) -> TestTree -> TestTree
I'm trying to test a Servant application, so I'd like to use Warp.testWithApplication per servant's testing tutorial, but this is a with*-style function (one that calls your action and manages the resource for you), i.e. the type is:
testWithApplication :: IO Application -> (Port -> IO a) -> IO a
am I missing something or is it really hard to glue the two together given that I don't have an initializer/cleanup function but a wrapper with... function?
Note
I know I can just wrap the whole test-suite with testWithApplication (in main) but I'd prefer if the API was started only for the TestTree that requires it.