rtfeldman / rtfeldman/node-test-runner

Organizational options for elm tests in other opinionated ecosystems?

Open
#281 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
140
Forks
83
Avg merge
8h 25m
Merged PRs (30d)
5

Description

I mentioned this in Slack today, and @avh4 suggested I open an issue here describing my use case, so here goes:

At work we have an Ember project that I've planted a few Elm seeds in (here's hoping they grow). One thing I encountered in the upgrade to 0.19 is that both Ember and Elm have opinions about what should go in the tests directory at the root of a project. Ember wants some configuration and a lot of sub-directories for different types of tests in there, and elm-test expects all of the test modules to live there. With 0.18, I could just push my elm tests down to tests/elm/ since the tests were more like a second project.

Just dropping a bunch of FooTest.elm files on top of the Ember testing structure is a bit rough organizationally, so I've considered a few different options as workarounds:

  1. Make a Test directory inside tests and have modules named Test.Foo instead of FooTest. This is what I did just to get things working for now. It's not likely to be particularly intuitive for new devs trying to find their way around in the repo though, and I'm going to get a lot of "turtles all the way down" jokes from the rest of my team.

  2. Stick with a pattern similar to tests in 0.18 where there's a sub-project in tests/elm that shares source directories and dependencies with the main project elm.json. The downside here is that there's manual overhead in keeping the two configurations in sync.

  3. Lift all of the Elm code and elm.json out of Ember's folder structure and just put it at the top of the repo as it's own sub-project. This would require updates to addon we're using for integration with Ember's build system, and probably adding some tooling for ember-cli so that installing Elm dependencies didn't require always dropping into the sub-project. I suspect this is the best long-term option for us.

The other option would of course be to make the location of tests configurable when running elm-test, but I'm not sure that's worth it just to accommodate this particular use case. I'd be curious if folks embedding Elm in other opinionated frameworks like Angular have similar problems, or if anyone can think of additional/better approaches.

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

Review elm-test's assumptions about the root tests directory alongside the tests/elm and elm.json layouts described in the issue. Compare the Ember and Elm organizational constraints, then establish an agreed supported arrangement or configurable test location before implementation; completion should include a documented, tested approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
testing-qa, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.