lambdaisland / lambdaisland/kaocha-cljs

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

Open
#47 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation good first issue
Dominant language
Clojure
Stars
47
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cljs.repl.browser/default-index and the :repl-opts/:static-dir configuration described in test.edn. Reproduce the setup using test/index.html and out/main.js, then determine whether the supported outcome should be documented or whether a testing-specific index page should work. Done means the Kaocha ClojureScript client connects reliably with the documented configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
testing, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.