lambdaisland / kaocha-cljs

ClojureScript support for Kaocha
Eclipse Public License 1.0
40 stars 10 forks source link

[cljs.repl.browser/repl-env] index.html must use out/main.js? #47

Open WillForan opened 2 years ago

WillForan commented 2 years ago

Not an issue. Just something that took me long enough to realize that I thought it worth writing down. When there's no index.html in ./ or out/, the repl index template cljs.repl.browser/default-index is used and tests run. But when an index is within the :static-dir vector (?), I was catching

Kaocha ClojureScript client failed connecting back.

Adding <script src="out/main.js"> </script> in the body of index.html resolved this! The browser can't talk back to kaocha without loading the instructions to do so -- painfully obvious now, not so much an hour ago.

I'm not yet familiar enough with all the repl options to come up with other solutions. It's fine for me to have a 404 script in at the bottom of index.html for all but tests. But still, I though I could make a testing specific index page (e.g. test/index.html) with something like :repl-opts {:static-dir ["test/" "." "out/"]} in test.edn. But I haven't gotten that to work.

alysbrooks commented 1 year ago

Hi @WillForan, a (belated) thank you for the issue! I think we can add some documentation around this.

alysbrooks commented 1 year ago

I think this is a reasonable thing to document (and should be a pretty quick fix), so I'm leaving this open.