tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.74k stars 139 forks source link

Support running tests for ClojureScript files #369

Open heralden opened 5 years ago

heralden commented 5 years ago

:RunTests runs the Clojure tests for the namespace when invoked from a .cljs file, and cpr only does a :Require.

Any chance of adding support for cljs.test? It seems it can be a bit tricky with s:capture_test_run as it uses many clojure.test functions that aren't present in cljs.test.

tpope commented 5 years ago

I'm open to ideas.

dhleong commented 4 years ago

It's probably still missing some cases, but I've been working with this for some time: https://github.com/dhleong/vim-hearth/blob/master/autoload/hearth/test/cljs.vim

sheluchin commented 4 years ago

As far as cpr goes, I think part of the problem is that vim-fireplace tries to call load-file on a resource path, but it expects an actual file path. So, while the src/test is on the classpath, using (load-file "foo/some-test.cljs") on src/test/foo/some-test.cljs will not work anyway - it needs to call (load-file "src/test/foo/some-test.cljs").

Also worth noting that shadow-cljs added support for relative paths fairly recently.