Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cd64093

Browse files
committedMar 9, 2024·
fix reload-all and test
1 parent 95ce24b commit cd64093

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed
 

‎project.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
~(with-meta '[org.clojure/tools.namespace "1.3.0"]
2020
;; :cognitest uses tools.namespace, so we cannot inline it while running tests.
2121
{:inline-dep (not= "true" (System/getenv "SKIP_INLINING_TEST_DEPS"))})
22-
^:inline-dep [io.github.tonsky/clj-reload "0.4.0"]
22+
^:inline-dep [io.github.tonsky/clj-reload "0.4.1"]
2323
^:inline-dep [org.clojure/tools.trace "0.7.11"]
2424
^:inline-dep [org.clojure/tools.reader "1.3.6"]
2525
[mx.cider/logjam "0.3.0"]]

‎src/cider/nrepl/middleware/reload.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
reload (user-reload 'reload reload/reload)
3838
unload (user-reload 'unload reload/unload)]
3939
(cond
40-
(:all msg) (reload (assoc opts :all true))
40+
(:all msg) (reload (assoc opts :only :all))
4141
(:clear msg) (unload opts)
4242
:else (reload opts))))
4343

‎test/clj/cider/nrepl/middleware/reload_test.clj

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(:require
33
[cider.nrepl.middleware.reload :as rl]
44
[cider.nrepl.test-session :as session]
5+
[clojure.string :as str]
56
[clojure.test :refer :all]))
67

78
(use-fixtures :each session/session-fixture)
@@ -33,8 +34,10 @@
3334

3435
(deftest reload-all-op-test
3536
(testing "reload-all op works"
36-
(let [response (session/message {:op "cider.clj-reload/reload-all"})]
37-
(is (seq (:progress response)))
37+
(let [response (session/message {:op "cider.clj-reload/reload-all"})
38+
progress-str (:progress response)]
39+
(is (str/includes? progress-str "Unloading cider.nrepl.middleware.util.meta-test"))
40+
(is (str/includes? progress-str "Loading cider.nrepl.middleware.util.meta-test"))
3841
(is (= #{"done" "ok"} (:status response))))))
3942

4043
(deftest reload-clear-op-test

0 commit comments

Comments
 (0)
Please sign in to comment.