Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom tests location #46

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

robyoder
Copy link

@robyoder robyoder commented Jan 27, 2022

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:

  1. Fix local elm make in 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 make failed there with some concerns about elm.json. Even though elm-test worked fine, I figured it was worth improving the integrity of the test project.

  2. Ignore generated coverage files — running elm-coverage in the test project generated coverage files that were not ignored.

  3. Support multiple test projects — the existing tests had simple hardcoded throughout, so to avoid duplicating them all, I refactored them into a loop that could be extended with additional test projects.

  4. Add (failing) tests for custom tests location — this is a copy of the simple case, adjusted to showcase the issue outlined in Cannot run with non-default tests location #44. I committed this alone so it would be easy to verify the failure and the coming fix.

  5. 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.json file remains accurate.

  6. Remove unused lines — tiny cleanup of unused lines that distracted me when I was reading lib/runner.js.

@robyoder
Copy link
Author

Hey, @zwilias, can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot run with non-default tests location
1 participant