Fork me on GitHub
#cursive
<
2022-06-14
>
kenny23:06:52

Loving the removal of huge tooltips from the clojure.test integration. Perhaps this is already know, but these huge, ui-freezing tooltips still occur when big exceptions are thrown. This will be noticeable with most exceptions from spec instrumentation.

1
cfleming19:06:53

Do you mean when big exceptions are thrown in tests? I thought I had caught all those cases. Can you give an example of a simple case where the exception is still shown in a tooltip?

kenny22:06:21

Sure. Here's a smaller example like the one I mentioned. Since Spec includes the original value in its exceptions, you can imagine with a sufficiently large value, this exception will get massive and lock up the UI like before. In this case, I'm hovering around is. I'm not quite sure why the docs are below the exception but they are in this case. I pasted the code below for convenience.

(defn my-add
  [x y]
  (+ x y))

(s/fdef my-add
  :args (s/cat :x number? :y number?)
  :ret number?)

(deftest my-add-test
  (clojure.spec.test.alpha/instrument)
  (is (= 3 (my-add 1 "")))
  (clojure.spec.test.alpha/unstrument))

cfleming09:06:02

Thanks, that helps, I'll try to handle this case better. The docs are shown because they're shown when you hover in the editor, and then it tacks the tooltip (if any) on the front. I was surprised by that too.

1