elm-coverage is a tool that will instrument Elm code and when you run it, output coverage counters and generate an HTML report.
The problem I had with this tool is that it outputs the report into a single large HTML file. Opening this file in the browser for a 200K LOC Elm project is pretty slow. Trying to get AI coding tools to read it is also difficult.
I forked the original and am making some changes here:
So far:
- It outputs the HTML report with 1 overall file mapping the whole project, and 1 HTML file per module, in a directory structure that 1:1 reflects the source code.
- You can output a JSON formatted report with
--report jsonCLI option.
The JSON formatted report is much smaller and better for AI coding tools to consume.
Things I would like to add:
- Support for running tests via elm-test-rs.
No published version yet, but you can easily build and try it out locally instructions are in the README.