Closed juszczakn closed 5 months ago
Ok, I updated the PR to follow the IT test standard.
I'm not sure why the workflow is failing for cljs? I don't really understand the error message and I don't have any cljs experience at all, so I'm kinda lost there.
ERROR in (check-test) (Error:NaN:NaN)
Uncaught exception, not in assertion.
expected: nil
actual: #error {:message ":malli.generator/no-generator", :data {:type :malli.generator/no-generator, :message :malli.generator/no-generator, :data {:options {:malli.core/function-checker #object[malli$generator$function_checker], :malli.generator/original-generator-schema #object[malli.core.t_malli$core24556]}, :schema #object[malli.core.t_malli$core24462]}}}
instrumentation tests were testing all registered function schemas using generative testing. I added a namespace-filter that it only tests functions from that namespace. See https://github.com/metosin/malli/pull/987/commits/2caabf1f2aafb79a32808eb0f1fb99ea8810e1ff.
the schema [:=> [:cat int? [:fn #(int? %)] int?] [:fn #(int? %)]
can be tested with generative testing as the :fn
doesn't generate anything. In real life, if you need :fn
that can generate values, you could mark it to use :int
generator:
[:=> [:cat int? [:fn {:gen/schema :int} #(int? %)] int?] [:fn {:gen/schema :int} #(int? %)]
Thanks!!
Trying to fix #836 . When using a predicate fn schema inside of a function schema, it would output a the type as :fn, such that clj-kondo checked that the arg provided is a fn and not of type any.
Ex: