Fork me on GitHub
#re-frame
<
2019-10-06
>
royalaid16:10:33

Hey all I am trying use re-frame-test to test the re-frame-async-flow-fx I have for my Auth flow. The problem is that whenever shadow-cljs hot-reloads the page when a test file changes I get a whole bunch of

re-frame: overwriting :event handler for: :auth/flow
re-frame: overwriting existing post event call back with id: :auth/flow
re-frame: no :event handler registered for: :auth/flow
on each reload

royalaid16:10:52

and the number of those lines increases by 1 each time e.g.

re-frame: overwriting :event handler for: :auth/flow
re-frame: overwriting :event handler for: :auth/flow
re-frame: overwriting existing post event call back with id: :auth/flow
re-frame: overwriting existing post event call back with id: :auth/flow
re-frame: no :event handler registered for: :auth/flow
re-frame: no :event handler registered for: :auth/flow

royalaid16:10:23

it seems like shadow doesn't realize this one test is in fact one test and keeps making a new test each time it runs

royalaid16:10:45

I have made sure the flows get torn down correctly upon completion

royalaid16:10:19

so I am little lost by the magic of what is happening inside run-test-async and wait-for

jahson17:10:44

The warnings is ok for reloading, but the increasing is not. Does your async-flow-fx have an id?

royalaid17:10:23

yeah, :auth/flow

jahson18:10:22

Looks like the registration of async flow is happening each time, but the reason is not clear. You could look into https://github.com/Day8/re-frame-async-flow-fx/blob/master/test/day8/re_frame/async_flow_fx_test.cljs, maybe it contains some kind of hints on how to test async-flow-fx