Can't get elm-test to work

I can’t get elm-test to work, and my attempts to fix it are digging me into a deeper hole.

I posted this on slack:


I’m struggling with elm-test .
I ran elm-test init in the root directory and it created /tests/
But, when I run elm-test in the root directory, it fails because it’s looking for
/tests/tests

Error: /home/alan/ElmDev/Proj/tests/tests does not exist. Please create a tests/ directory in your project root!
Did I do something wrong? Is there a bug? How can I fix this?


I had some nice replies from one person, but nothing worked.

I decided to try removing the ‘tests’ part of elm.json and the entire /tests directory.
And then I ran elm-test init again. But this resulted in:

Unable to create temporary directory for elm-test install. TypeError: Cannot read property 'direct' of undefined
    at Object.install (/usr/local/lib/node_modules/elm-test/lib/install.js:40:37)
    at Object.<anonymous> (/usr/local/lib/node_modules/elm-test/lib/elm-test.js:164:11)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/elm-test/bin/elm-test:3:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

I have tried uninstalling and re-installing elm-test
sudo npm uninstall -g elm-test then sudo npm install -g elm-test
— but I still get the same error.

I then wondered if I should have installed the package through elm and tried elm install elm-community/elm-test, but that resulted in

-- OLD DEPENDENCIES --------------------------------------------------- elm.json
The following packages do not work with Elm 0.19.0 right now:
    elm-community/elm-test

Help.

You want https://github.com/elm-explorations/test which is the current home of elm-test. It’s in the repo description, didn’t know that until now

Thank you, Martin!

Simply running elm install elm-explorations/test has fixed everything — all working as expected now :grinning:

Just to close a loop, https://github.com/elm-community/elm-test now redirects via README link to elm-explorations/test

1 Like