-
Notifications
You must be signed in to change notification settings - Fork 149
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 testing host methods #450
base: develop
Are you sure you want to change the base?
Add testing host methods #450
Conversation
@ali-abrar this PR is for the base test module I've been using. See description for link to reflex-vty test module that's built on top of this. I'm planning on writing UTs for reflx-vty using this test module so ideally I'd like this to be in the base reflex library so that I don't have to pull in pdlla/reflex-test-host as a dependency into reflex-vty (or some other solution). Note, admittedly, the test monad is rather convoluted and I have only written very basic tests using it. Still, I think it's the right way to go and about as simple as it can be. I should be writing more complicated test cases soon-ish however I thought it'd be better to open this PR now to get the conversation going. |
review pls :)? |
making my quarterly check in to see if anyone is available to review :) |
@pdlla perhaps it is fine, but I would be more confortable of the |
@Ericson2314 that's fine with me. And I guess tests can also be moved to separate project so that the main library does not need to depend on it. A review would definitely still be appreciated. Somewhat related: Is there any place where reflex libraries are documented? Not just for this library, but for other reflex libraries. That was definitely one of the biggest challenges for me when learning to use reflex--bad discovery on up to date supporting libraries and examples :(. |
This PR introduces test host module into Reflex to facilitate testing. There are two parts:
This is a module is a merge of https://github.com/pdlla/reflex-test-host I think it's a good addition to the main reflex library. I also need Reflex.Test.Monad.Host for some of the work I plan on doing for reflex-vty.
I've already been using this library extensively in my project https://github.com/pdlla/potato-flow you can see many examples of usage in the test/*.
There's also a reflex-vty layer built over the testing monad. You can see some basic examples here https://github.com/pdlla/potato-flow-vty (see Reflex/Vty/Test/Monad/Host.hs and test/*) I'm also using this to test functionality I'm adding to reflex-vty. You can see a more sophisticated example of this here.
Note 1: this resolves issue #412
Note 2: happy to remove hspec dependency