Fork me on GitHub

is there a way to generate test coverage reports for Clojurescript code?


it's quite easy on the jvm but I can't find anything for Clojurescript


hmm testing? like a result file with how all the tests went?


but for Clojurescript. It's a lot more difficult since it's compiled to JS, but in theory we have source maps and there are many JS tools to generate the report


the fact that I find nothing googling around makes me think it's not going to be easy


one might be able to leverage self-hosted CLJS to create a cloverage-like tool


but that assumes the code you’re covering can be run in self-hosted, which isn’t always the case


Since you mentioned self-hosted, if I have a ClojureScript library (core.rrb-vector in particular is on my mind, since I've been doing bug fixed for it recently), is there some command or three one can run to determine whether a library supports self-hosted, and if not, what parts of the code are stopping that?


typically self-hosted breaks on macros that requires and/or uses part of the JVM


e.g. a macro that calls a function that uses Integer/parseInt


there’s not really a good way to determine that, other than to load the code and inspect the error 😕


it can often be pretty deep in your dependencies too… like a macro that calls some library that uses some library that calls a Java method


Are there instructions you know of for attempting to load a library in a self-hosted cljs environment? I doubt it is difficult -- just have never done it.


Hmm, I found and am reading through to see if I can learn from there.


using lumo or planck might be enough


One thing that helps with the coverage issue is to have as much code as possible in cljc files


Which means you can use cloverage as usual and you get frontend coverage for free in a way. You can get quite far with that but would be nice to get the rest


According to this Wikipedia page on the Spidermonkey JS runtime, version 1.8.5 was first released in 2011, and there have been new versions released every year. Is it a little odd that on a Mac brew install spidermonkey installs that old version?


if no one is actively maintaining that brew, then it might not be up to date


Sure. Just kinda weird in a sea of packages that do seem pretty up to date. I recently got a new Mac and decided to try Homebrew instead of MacPorts to see if I was missing out. That and there is a brew install clojure for the new Clojure CLI tools, but nothing like that for MacPorts.


Yeah. I don't think people are often doing much dev with spidermonkey tbh


My bet would be Apple's jscore is used way more. v8 (due to node) probably more than that


I use brew and 90% of packages I want are on there, and if a project is actively maintained it usually will end up there