Is there a reasonably simple way to implement generative tests on an async function? It looks like this might be impossible without reimplementing test.check or clojure.spec.test.alpha/check?
it depends how you do your async functioning
if you just call async functions with abandon, it is hard, if create a an Executor that you can shutdown and run them on that Executor it is pretty easy
basically, if you can put a function like interface on it, it doesn't matter if internally it does stuff asynchronously
For cljs it's impossible
@gfredericks That's the conclusion I was coming to 😞
Yeah, it will take some work to add that
Definitely a priority
I'm trying to test a remote call to R against a cljs call which should return the same values and was hoping to get test.check style behaviour.
remote call = ajax?
yep
A couple heavy workarounds: test from clj, either by rewriting your logic in cljc or shelling out to node
Neither of those are nice obviously
Interesting idea though. I suspect the stats model would port to clj without too many problems.
Thanks - I'll think about that approach.