Skip to content

Conversation

@ahankinson
Copy link
Contributor

Running elm-test-rs on the test suite flagged an issue with the tests missing the elm/random dependency.

Random is imported in tests/ArrayTests.elm, but not listed in the test-dependenceies section of the elm.json.

I'm not sure how the regular tests are passing without this import, as it doesn't even seem to be a transient dependency. It might be that because elm/random is a dependency of elm-test itself, it doesn't flag it?

Anyway, it seems that both testing tools work with this change.

Running elm-test-rs on the test suite flagged an issue with the tests missing the elm/random dependency.

Random is imported in tests/ArrayTests.elm, but not listed in the test-dependenceies section of the elm.json.
@lydell
Copy link
Contributor

lydell commented Jul 18, 2025

I'm not sure how the regular tests are passing without this import, as it doesn't even seem to be a transient dependency. It might be that because elm/random is a dependency of elm-test itself, it doesn't flag it?

Almost. To run tests, test runners generate en Elm app behind the scenes and run it. elm-test (node-test-runner) adds elm/random to the direct dependencies of that application (because it needs it for internal stuff), which means that in tests you (unfortunately) secretly have access to elm/random even if you don’t depend on it. https://github.com/mpizenberg/elm-test-rs#differences-with-elm-test

So this PR is doing the right thing!

@miniBill miniBill merged commit aec2fb4 into elmcraft:master Jul 18, 2025
2 checks passed
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.

3 participants