Fork me on GitHub
#vim
<
2017-09-23
>
dominicm08:09:26

I discovered that there's a test runner in cider the other day. I created this little monster: command! -buffer RunProjectTests call fireplace#capture_test_run('(clojure.test/run-all-tests #"('.luaeval('_A:sub(2,-2)', fireplace#eval('(apply str (interpose "|" (cider.nrepl.middleware.util.namespace/loaded-project-namespaces)))')).')")', '') | copen Requires a vim with lua.

dominicm08:09:17

It runs the tests for only those in your project. Think :RunTests but without having to provide a regex for your current project.

dominicm08:09:32

But there's a better version of this to be written, where you use the cider-nrepl ops, which produce test results as data, so you can do:

if res.failed == 0
  echo "Passed"
else
  quickfix_populate
  copen
endif