This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-08
Channels
- # beginners (76)
- # boot (13)
- # cider (3)
- # clara (7)
- # cljs-dev (254)
- # cljsrn (5)
- # clojure (20)
- # clojure-austin (2)
- # clojure-chicago (4)
- # clojure-dev (7)
- # clojure-russia (5)
- # clojure-spec (18)
- # clojurescript (68)
- # cursive (8)
- # datascript (3)
- # datomic (8)
- # garden (1)
- # hoplon (3)
- # lambdaisland (4)
- # luminus (20)
- # mount (19)
- # off-topic (30)
- # om (10)
- # onyx (8)
- # parinfer (14)
- # precept (7)
- # reagent (9)
- # unrepl (3)
- # untangled (72)
- # vim (4)
- # yada (1)
Still have to use Evaluate Expression, which is a little clunky but has the advantage of allowing the result to be explored.
indeed thank you!
is there anyone here using tolitius/mount
or aroemers/mount-lite
with cursive?
im trying the with-session
feature of mount-lite (https://github.com/aroemers/mount-lite/blob/2.x/src/mount/lite.clj#L207-L218) which creates a separate thread.
i thought i would just wrap my tests using with-session
inside an :each
fixture:
(defn with-test-db [tests]
(-> (mount/with-session
(mount/with-substitutes
[#'conn (test-conn)]
(mount/start))
(tests))
:result deref))
(use-fixtures :each with-test-db)
(deftest test-inside-session-using-fixtures
(tx! [{:db/id "e" :str "asd"}])
(is (= {:str "asd"}
(q '[:find (pull ?e [:str]) .
:where [?e :str "asd"]]))))
— https://gitlab.com/onetom/mount-lite-example/blob/master/test/app/pretty_db_test.clj#L7-21but as a result i was surprised with some cursive test integration internals when i Run tests in current NS in REPL:
Loading test/app/pretty_db_test.clj... done
Running tests in app.pretty-db-test
Testing app.pretty-db-test
===>>> Setting up test DB <<<===
@#Cursive#TestSupport#@ {:file "pretty_db_test.clj", :line 21, :class "app.pretty_db_test$fn__4511", :type :pass, :expected "(= {:str \"asd\"} (q (quote [:find (pull ?e [:str]) . :where [?e :str \"asd\"]])))", :message nil}
===>>> Tearing down test DB <<<===
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
sometimes i get the test summary way ahead of time:
Loading test/app/pretty_db_test.clj... done
Running tests in app.pretty-db-test
Testing app.pretty-db-test
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
===>>> Setting up test DB <<<===
@#Cursive#TestSupport#@ {:file "pretty_db_test.clj", :line 19, :class "app.pretty_db_test$fn__5225", :type :fail, :expected "(= {:str \"asd\"} (q (quote [:find (pull ?e [:str]) . :where [?e :str \"asd\"]])))", :actual "(not (= {:str \"asd\"} nil))", :message nil}
===>>> Tearing down test DB <<<===