File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
test/clj/cider/nrepl/middleware Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 4
4
; ; Ensure tested tests are loaded:
5
5
cider.nrepl.middleware.test-filter-tests
6
6
[cider.nrepl.test-session :as session]
7
- [clojure.test :refer :all ]))
7
+ [clojure.test :refer :all ])
8
+ (:import
9
+ (clojure.lang ExceptionInfo)))
8
10
9
11
(use-fixtures :each session/session-fixture)
10
12
165
167
:actual exception}))
166
168
(is (= [exception]
167
169
@proof))))))
170
+
171
+ (defn throws []
172
+ (throw (ex-info " ." {})))
173
+
174
+ (defn comparable-stack-frame
175
+ " A stack-frame map without varying parts that make testing more cumbersome."
176
+ [stack-frame]
177
+ (dissoc stack-frame :file-url :line ))
178
+
179
+ (deftest stack-frame-test
180
+ (let [e (try
181
+ (throws )
182
+ (catch ExceptionInfo e
183
+ e))]
184
+ (is (= {:fn " throws"
185
+ :method " invokeStatic"
186
+ :ns " cider.nrepl.middleware.test-test"
187
+ :name " cider.nrepl.middleware.test_test$throws/invokeStatic"
188
+ :file " test_test.clj"
189
+ :type :clj
190
+ :var " cider.nrepl.middleware.test-test/throws"
191
+ :class " cider.nrepl.middleware.test_test$throws"
192
+ :flags #{:project :clj }}
193
+ (comparable-stack-frame (test/stack-frame e throws )))
194
+ " Returns a map representing the stack frame of the precise function
195
+ that threw the exception" )))
You can’t perform that action at this time.
0 commit comments