Basic setup question: my repl doesn't seem to find test.check, although it is .m2/repositories :
deps.edn:
{:paths ["src"]
:deps {org.clojure/tools.namespace {:mvn/version "1.5.0"}
org.clojure/clojure {:mvn/version "1.12.0"}
org.clojure/core.async {:mvn/version "1.6.681"}}
:aliases
{:test
{:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}
org.clojure/test.check {:mvn/version "1.1.0"}}
:main-opts ["-m" "kaocha.runner"]}}}
test-namespace:
(ns admin-orbis.workflow.scheduler-test
(:require [clojure.test.check.generators :as gen]
[admin-orbis.workflow.scheduler :as sut]
[admin-orbis.workflow.scheduler-spec])
(:import [java.util UUID]))
Whenever I want to load the latter namespace in the repl, I get:
user-test> (ns admin-orbis.workflow.scheduler-test
(:require [clojure.test.check.generators :as gen]
[admin-orbis.workflow.scheduler :as sut]
[admin-orbis.workflow.scheduler-spec])
(:import [java.util UUID]))
Execution error (FileNotFoundException) at admin-orbis.workflow.scheduler-test/eval22484$loading (REPL:11).
Could not locate clojure/test/check/generators__init.class, clojure/test/check/generators.clj or clojure/test/check/generators.cljc on classpath.
user-test> (require '[clojure.test.check.generators :as gen])
Execution error (FileNotFoundException) at user-test/eval22488 (REPL:18).
Could not locate clojure/test/check/generators__init.class, clojure/test/check/generators.clj or clojure/test/check/generators.cljc on classpath.
user-test>
checking if I have test.check running:
ls ~/.m2/repository/org/clojure/test.check/1.1.0/
_remote.repositories test.check-1.1.0.jar test.check-1.1.0.jar.sha1 test.check-1.1.0.pom test.check-1.1.0.pom.sha1
what am I missing?You need to start your repl with the :test alias enabled to have those deps on the classpath
clj -A:test
that makes sense. So when I run the repl from emacs (spacemacs), it probably won't have the test dependencies by default, right?
Starting new CIDER session ...
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.3.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.50.2\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\]\"\]\}\}\} -M:cider/nrepl
[nREPL] server started on 46779
[nREPL] Establishing direct connection to localhost:46779 ...
[nREPL] Direct connection to localhost:46779 established
CI’d suggest putting the deps top level to unblock you and then come ask in #cider how to work with the aliases
allright, thx!