Fork me on GitHub

quick q about loading files after a cider-jack-in - I am trying to C-c C-k / "load buffer" in a file with a number of test cases which is require-ing a number of dependencies from elsewhere in my project. Naturally this does not work, as these dependencies have not been loaded into the new REPL session. What's the shortest path to load only required dependencies so I can execute tests in the current test file? Do I need to just run cider-load-all-project-ns to load all namespaces in the project? Is there a reason or a gotcha for why I shouldn't do that whenever I start a session?


Why doesn’t this work? Every file should be loadable. It will just require it’s own dependencies


The immediate failure I got was an FileNotFoundException for a dependency which ends in an unhandled CompilerException. I think this could be caused by a missing alias (I need to set up dir-locals). I'll report back if I can't resolve the problem. It doesn't appear that it is able to find a dependency on the classpath though which makes me think that not loading my "test" alias which defines the :extra-paths field where my tests live may be causing C-c C-k to fail


it can’t find token.clj. Are you requiring a namespace called token?


presumably you are in a test file at test/token_test.clj


Correct in both deductions.


so nothing cider related really. type in the repl (require 'token) if that fails nothing CIDER can do


and your classpaths aren’t set correctly


I'll figure out how to get them set up properly. Thanks @U11BV7MTK


my suggestion is to remove CIDER until it works


clj from a command line. (require 'token-test) (clojure.test/run-tests 'token-test)


once that works it should work in CIDER


I'll take your advice and start there


it was a bad path in the :paths attribute of my deps.edn ! I must not have noticed because I had loaded buffers one at a time when creating them the other day. Thanks for the direction

👍 4