elm-coverage
elm-coverage copied to clipboard
Support custom tests location
The docs indicate that a custom tests location is supported using the --tests arg, but as shown in #44, this doesn't actually work.
Resolves #44
The fix was a single line change, but there was a bit of work to do to add a test project to show the issue. I've split the commits into semantic chunks that should tell a pretty clear story:
-
Fix local
elm makein test project — when I was looking to add a new test project I started by trying to build and run the tests in the existing one.elm makefailed there with some concerns about elm.json. Even thoughelm-testworked fine, I figured it was worth improving the integrity of the test project. -
Ignore generated coverage files — running
elm-coveragein the test project generated coverage files that were not ignored. -
Support multiple test projects — the existing tests had
simplehardcoded throughout, so to avoid duplicating them all, I refactored them into a loop that could be extended with additional test projects. -
Add (failing) tests for custom tests location — this is a copy of the simple case, adjusted to showcase the issue outlined in #44. I committed this alone so it would be easy to verify the failure and the coming fix.
-
Fix issue with custom tests location — the one-line fix: wherever the tests were before, they should still be in the instrumented directory so that the
elm.jsonfile remains accurate. -
Remove unused lines — tiny cleanup of unused lines that distracted me when I was reading lib/runner.js.
Hey, @zwilias, can you take a look?