Clojurescript
provides powerful tools and semantics for testing code like deftest
and test.check
(generative testing).
This repository is a template for testing javascript
code with clojurescript
code.
There is a javascript
file main.js
that defines a javascript
function foo
.
There is a clojurescript
file core_test.cljs
that tests foo
.
In project.clj
, main.js
is defined as a :foreign-libs
, so we can :require
it from clojurescript
.
The tests are run with lein doo.
Simple, no?
lein doo phantom test
Modify the code of the test inside src/js_test_in_cljs/test/core_test.cljs
and the tests re-run automatically in under 1 second.