Skip to content

Commit 3b3da5b

Browse files
committed
Handle exceptions when running tests
1 parent 51997d1 commit 3b3da5b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

clojure/io/julienvincent/clojure_test/runner.clj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323

2424
(defn run-test [test-sym]
2525
(binding [*report* (atom [])]
26-
(with-redefs [test/report
27-
(fn [report]
28-
(swap! *report* conj (parse-report report)))]
29-
(test/run-test-var (resolve test-sym)))
26+
(with-redefs [test/report (fn [report]
27+
(swap! *report*
28+
conj
29+
(parse-report report)))]
30+
(try (test/run-test-var (resolve test-sym))
31+
(catch Exception ex
32+
(swap! *report* conj {:type :error
33+
:exceptions (serialization/analyze-exception ex)}))))
3034
@*report*))

0 commit comments

Comments
 (0)