Closed frenchy64 closed 2 months ago
Thanks!
@frenchy64 could you explain a bit more about why you made this change? Why can’t CLJ and CLJS both use pr-str?
We have CLJC tests which include Malli error messages. Now we need to use reader conditionals on the error message to have them pass in both CLJS and CLJ.
I'm told pr-str in cljs is too expensive to use because it pulls in too much code after minification.
-------- Original Message -------- On 6/1/24 03:51, Daniel Compton wrote: @frenchy64 could you explain a bit more about why you made this change? Why can’t CLJ and CLJS both use pr-str? We have CLJC tests which include Malli error messages. Now we need to use reader conditionals on the error message to have them pass in both CLJS and CLJ. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
To close the loop here: we ended up overriding malli.error/-pr-str
in our tests to get consistent output:
(t/use-fixtures
:once
(fn [f]
(with-redefs [me/-pr-str pr-str]
(f))))
A bit naughty, but keeps reader conditionals away from the tests.
For clj use
pr-str
, for cljs usestr
.