hey guys… does anyone know why
(defspec foo-test 100
(prop/for-all [m (s/gen ::bool-kv)] ,,,
is failing when run in clojurescript with lein-doo in phantomjs? throws this:
ERROR in (foo-test) (clojure$test$check$generators$call_gen@file:222:20)
Uncaught exception, not in assertion.
expected: nil
actual: #object[TypeError TypeError: null is not an object (evaluating 'generator_fn.call')]
@ag my work mate had a similar problem to that and it was due to not requiring something
I was surprised that cljsbuild didn’t warn about it
Your mileage may vary, but it’s worth checking
actually same code works when compiled javascript directly passed to karma (without using lein-doo)
I want to use lein-doo though
Are they using different compiler modes? i.e. advanced vs none?
it completely breaks with :simple.
java.lang.AssertionError: Assert failed: No file for namespace my-app.test-runner exists
with :whitespace it fails with a different error:
Error: Cannot find module 'function (f) {if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}}’
Seems like a require error, but I don’t know too much more
I have created issue https://github.com/bensu/doo/issues/118
I think it’s quite likely not to be a doo error
Try requiring clojure.test.check.generators
Possibly shouldn’t need to, but I think it might be a bug in the cljs compiler if it’s not warning about it
still the same 😞
I asked my co-worker and his was clojure.test.check.properties
I do have that require
[clojure.test.check.properties :as prop]
OK, I’ve got nothing then 🙂
so I’m wondering if it has something to do with how I require clojure.spec.generators?
so here’s the thing to require clojure spec, in clojurescript you can either do require '[cljs.spec,,,
or require '[clojure.spec,,,
but when it comes to generators it’s not that smart
you can’t do require '[clojure.spec.generators]
Maybe
I found a way to include them like this [cljs.spec.impl.gen :as gen]
but maybe that’s not completely right?
but then why the same code compiled and run outside of doo works fine?