thheller / shadow-cljs

ClojureScript compilation made easy
https://github.com/thheller/shadow-cljs
Eclipse Public License 1.0
2.23k stars 173 forks source link

More readable error log with pre-line for browser-test #1173

Open taehee-sp opened 4 months ago

taehee-sp commented 4 months ago

Proposal

It would be nice to add just one line css. .error-message { white-space: pre; }

MDN : white-space

image

I find the file. I will create Pull Request for it soon.

https://github.com/thheller/shadow-cljs/blob/a496c6febd36a7e9e6919180796f9ace81ff98e0/src/main/shadow/cljs/devtools/server/web.clj#L181

Problem

Error message is not readable. New lines are ignored.

image

package.json

"shadow-cljs": "2.25.2"

shadow-cljs.edn

  :test
  {:target :browser-test
   :test-dir "resources/public/test"
   :ns-regexp "-test$"
   :devtools
   {:http-root "resources/public/test"
    :http-port 3002}
  }
taehee-sp commented 4 months ago

https://github.com/thheller/shadow-cljs/blob/a496c6febd36a7e9e6919180796f9ace81ff98e0/src/main/shadow/test/browser.cljs#L8

Is it https://github.com/bhauman/cljs-test-display 's issue?

taehee-sp commented 4 months ago

here!

https://github.com/bhauman/cljs-test-display/blob/master/resources/public/com/bhauman/cljs-test-display/css/style.css#L213C1-L216C2

But it seems unmaintained for 4 years. 😢

thheller commented 4 months ago

Yes, cljs-test-display is the library currently used for this. I do have plans to change that though.

In the meantime you can just add the style needed to your index.html via a regular <style> tag. Or you can replace the actual .css file by making a copy and putting it into your classpath. If you already have a resources folder you can put it into resources/public/com/bhauman/cljs-test-display/css/style.css, or if you only have something like a src/test that would be src/test/public/com/bhauman/cljs-test-display/css/style.css. That should override the file from the library.