@hackage reflex-test-host0.1.0.0
reflex host methods for testing without external events
Installation
Dependencies (5)
Dependents (4)
@hackage/tinytools, @hackage/reflex-dynamic-containers, @hackage/reflex-potatoes, @hackage/tinytools-vty
reflex-test-app
This library contains functionality for writing unit tests for the "model" portion of your reflex-frp apps. Please see test/Reflex/Test/App.hs for basic usage example.
Note that the following two reflex class constraints are not supported:
-
PostBuildcould be added easily, but I noticed different hosts have different semantics on how to treatPostBuild, i.e. is it something that runs just ONCE after the first setup or after each frame. To avoid confusion, this library does not support the constraint though it could be added easily. For example, see reflex-basic-host. -
TriggerEventcould also be added with some effort but breaks the "pureness" of the test (at least from its inputs) so I don't suggest it. You can still test parts of your network that don't requireTriggerEvent
This library is modified from test/Test/Run.hs in the reflex main repository. I'll deprecate this module if the functionality is ever moved into an exposed module which I think it should be.
PRs are welcome. Perhaps you have some ideas to make the interface more useable.