Fork me on GitHub
#test-check
<
2020-08-31
>
gfredericks01:08:43

AOT wouldn't reproduce it because AOT doesn't run code at compile time

gfredericks01:08:53

I mean maybe it runs it but it only compiles the code, not the result

gfredericks01:08:33

a fix would be something that lazy-initializes the global rng the first time you use it, I guess?

gfredericks01:08:23

I don't think that's in a perf-sensitive codepath so I don't think there are any downsides

gfredericks01:08:00

sounds like a legitimate jira ticket

eval-on-point18:08:46

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

gfredericks18:08:12

Does the ticket reference a branch with a proof-of-concept?

eval-on-point19:08:29

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

gfredericks19:08:48

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.

eval-on-point19:08:54

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 🤷

gfredericks19:08:57

I, also, am surprised

gfredericks19:08:22

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?

eval-on-point19:08:34

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

borkdude21:08:51

@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

👍 3
👀 3