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

Recommend local rather than global install #249

Closed
RGBboy opened this issue Jan 30, 2018 · 4 comments · Fixed by #473 or elm-explorations/test#160
Closed

Recommend local rather than global install #249

RGBboy opened this issue Jan 30, 2018 · 4 comments · Fixed by #473 or elm-explorations/test#160

Comments

@RGBboy
Copy link

RGBboy commented Jan 30, 2018

I ran into an interesting problem where I wanted to run the tests of an existing elm library that had been set up to work with the previous version of elm-test but, because I had installed the latest version globally, was getting errors when trying to test. I have a good understanding of node and NPM so I was able to figure out the issue, however others may not be. I wonder if it would be better to recommend users to:

  • Install this npm package locally and set up a local package.json file to document the version installed.
  • Recommend consumers document how to run tests in their readme file.

Examples of the above could be provided here to make setting up elm test simple.

@RGBboy
Copy link
Author

RGBboy commented Jan 30, 2018

Also note that https://github.com/elm-community/elm-test currently recommends the global install too.

@razzeee
Copy link

razzeee commented May 14, 2018

I also wonder about this. As I'm currently tring to get this to work in this docker image https://github.com/bitwalker/alpine-elixir-phoenix via gitlab. And I don't think I can install globally due to the image enforcing correct user management.

@RGBboy any chance you can post how you were able to get this to run locally? Somehow I seem to not hit the correct parameters.

@razzeee
Copy link

razzeee commented May 14, 2018

Hrm npx elm-test seems to work flawless for me.

Edit: Nevermind, also fails on our CI with

Error extracting https://dl.bintray.com/elmlang/elm-test/0.18.12/linux-x64.tar.gz - Error: EACCES: permission denied, open '/opt/app/.npm/_npx/54/lib/node_modules/elm-test/bin/elm-interface-to-json'

@RGBboy
Copy link
Author

RGBboy commented May 15, 2018

@razzeee here is a project that I have elm-test setup locally: https://github.com/RGBboy/websocket-server. Essentially set it up as a node project too and add elm-test as a development dependency (npm install elm-test --dev). When you install node packages, it makes the {project}/node_modules/.bin available on the path when the current working directory is {project}. This means you have access to the local elm-test command.

I would structure it slightly differently now as the latest elm-test expects a test folder in the root of your project.

harrysarson pushed a commit that referenced this issue Jan 20, 2021
- Recommend installing locally. Fixes #249.
- Move more common flags first, both in the readme and in `--help`.
- Sync the descriptions between the readme and `--help`.
- Try to explain the difference between node-test-runner and elm-explorations/test.
- Document where to put your tests.
- Various other little tweaks to try to be more helpful.

PR for elm-explorations/test: elm-explorations/test#160

We should also update the repo description because it currently says:

> Runs elm-test suites from Node.js. Get it with npm install -g elm-test
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 a pull request may close this issue.

2 participants