AOT wouldn't reproduce it because AOT doesn't run code at compile time
I mean maybe it runs it but it only compiles the code, not the result
a fix would be something that lazy-initializes the global rng the first time you use it, I guess?
I don't think that's in a perf-sensitive codepath so I don't think there are any downsides
sounds like a legitimate jira ticket
Are there resources available for testing async code in cljs via test.check
? I see that there is an open ticket in jira for support, just wondering if there are any known workarounds that might allow me to still use defspec
Does the ticket reference a branch with a proof-of-concept?
I don't think the ticket references it, but I have seen that branch. Haven't tried the branch out yet, though. I can give it a roll and share how it works for our use case if you think that would be helpful
I was suggesting a "workaround" would be to just use that branch, if it works. Depends on your definition of workaround. I'm not sure there are any other options short of somebody completing integrating that feature. Coverting to async is a pretty fundamental change.
Cool, thanks for helping me out. I really appreciate it. I'll see how that goes. I'm a little surprised that this seems to be a rare scenario 🤷
I, also, am surprised
I haven't done much professional clojure web dev; maybe people tend to use frameworks where the user code is just functions on data, and so those user functions are amenable to synchronous testing?
Yeah, I think that is a big part of it. Most of the time there is already a well-supported React component for whatever library you want to integrate, so you do not need to worry about testing its behavior
@gfredericks > a fix would be something that lazy-initializes the global rng the first time you use it, I guess? https://gist.github.com/borkdude/768eb5d01085944190e5eb485fd4737a#workaround I'll make a JIRA ticket tomorrow