rtfeldman / node-test-runner

Runs elm-test suites from Node.js. Get it with npm install -g elm-test
BSD 3-Clause "New" or "Revised" License
135 stars 79 forks source link

Deduplicate src-dirs #637

Open drathier opened 4 months ago

drathier commented 4 months ago

I'd really like to deduplicate the test folders when they're exact matches; I have a project where I want to add the tests folder as an app src dir.

https://github.com/rtfeldman/node-test-runner/blob/3c18757ad8c4cd7a6b33459588fba14aa41b6b1d/lib/Project.js#L44

I'm getting this error if I add the tests folder to src-dirs:



/Users/drathier/drathier/elm-everything/tests/BasicsTests.elm

…matches more than one source directory:

/Users/drathier/drathier/elm-everything/tests
/Users/drathier/drathier/elm-everything/tests

Edit "source-directories" in your elm.json and try to make it so no source directory contains another source directory!

Note: The tests/ folder counts as a source directory too (even if it isn't listed in your elm.json)!```
drathier commented 4 months ago

I bet https://stackoverflow.com/a/33121880/596041 would be enough

lydell commented 4 months ago

I think it makes sense to not add the tests/ dir if it’s already in source-directories!

(Not sure about de-duplicating, though, I think it would make the most sense if elm-test and elm make gave the same error, instead of elm-test working while plain elm does not.)