Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testWai' that works better with withResource #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathanmoregard
Copy link

I was testing my wai application, and wanted to reset it between tests to isolate them from each other.
I found the function withResource :: IO a -> (a -> IO ()) -> (IO a -> TestTree) -> TestTree that seemed like a good fit, but I couldn't figure out how to use it together with testWai :: Application -> TestName -> Session () -> TestTree.

To make the pieces fit, I introduced testWai' :: IO Application -> TestName -> Session () -> TestTree.
This required changing the type of Sess to hold an IO Application instead of an Application.

Hopefully, this will be accepted, and help others that want to test wai apps with Tasty.
Please let me know if I can do anything else to make this PR agreeable to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant