stathissideris / spec-provider

Infer Clojure specs from sample data. Inspired by F#'s type providers.
519 stars 22 forks source link

Add support for self-hosted ClojureScript tests #24

Closed mfikes closed 6 years ago

mfikes commented 6 years ago

This patch would make it possible to run spec-provider's tests in self-hosted Lumo or Planck:

lein tach lumo

or

lein tach planck

If you run the tests, you will see that #22 needs to be fixed before the self-hosted tests will pass.

It bumps the test.check dep because 0.9.0 doesn't support self-hosted ClojureScript.

It unfortunately needs to add a duplicate of the existing spec-provider.cljs-test-runner namespace, which adds a maintenance burden in needing to be revised as new test namespaces are added. I can't think of a way to combine both into one because once you require doo.runner it automatically sets things up for itself, producing a warning like the following:

WARNING: doo's exit function was not properly set
#object[TypeError TypeError: null is not an object (evaluating 'doo.runner._STAR_exit_fn_STAR_.call')]

(ClojureScript unfortunately doesn't have a way to conditionally do a require.)

The copied test namespace also omits pjstadig.humane-test-output because it is evidently not compatible with self-hosted ClojureScript.

stathissideris commented 6 years ago

Many thanks for this and for your other PR fixing the format problem! I will release a new version later today.

mfikes commented 6 years ago

@stathissideris Support for self-hosted testing has landed in doo. When it is released, this might provide a cleaner way, avoiding a separate namespace for use with tach.

stathissideris commented 6 years ago

Thanks for the heads up @mfikes -- I've raised this as a reminder.