elm-explorations / test

Write unit and fuzz tests for Elm code.
https://package.elm-lang.org/packages/elm-explorations/test/latest
BSD 3-Clause "New" or "Revised" License
237 stars 39 forks source link

Installing elm-test without Node.js? #133

Closed JorelAli closed 4 years ago

JorelAli commented 4 years ago

Hi,

Currently the installation instructions for elm-test consist of installing it via the Node package manager using npm install -g elm-test.

Similarly, Elm itself can be installed using npm install -g elm, however lately its installation procedure consists of downloading premade binaries from its GitHub page (see here) which is significantly faster than installing via Node.js.


Getting straight to the point - is there a way to install elm-test without using the node package manager? I'm trying to use elm-test for CI and want the fastest possible install time.

harrysarson commented 4 years ago

npm i -g elm-test installs the node-test-runner which is a nodejs library. nodejs is required a) to run the test runner code itself and b) to run the javascript that the elm compiler generates.

So in a word no. I am sorry!


Could you install elm-test without npm? You could clone the git repo and try to go that way. However, the test runner has other js dependancies which would then have to be installed (via npm).

I think you are stuck with npm alas.

ShrykeWindgrace commented 4 years ago

A bit of nitpicking - you can install elm-test and required machinery without npm with the help of nix for example (if you are willing to pay the price of learning quite a few tools).

However, as @harrysarson said, you are still bound to the nodejs ecosystem, you just change the package manager.

Relevant link to elm-test in nixpkgs: https://nixos.org/nixos/packages.html?channel=nixpkgs-unstable&query=elm-test

JorelAli commented 4 years ago

A bit of nitpicking - you can install elm-test and required machinery without npm with the help of nix for example (if you are willing to pay the price of learning quite a few tools).

Relevant link to elm-test in nixpkgs: https://nixos.org/nixos/packages.html?channel=nixpkgs-unstable&query=elm-test

Hi, I'm well aware of the nix package manager, however under the hood it still uses node packages to install elm-test. This is unfortunately not a solution to my problem.

ShrykeWindgrace commented 4 years ago

@JorelAli maybe we use different definitions of the word "install". Nix indeed uses npm registry to fetch required packages

src = fetchurl {
        url = "https://registry.npmjs.org/elm-test/-/elm-test-0.19.1.tgz";
        sha512 = "SyZgZ/hxq62budS3k0M1Qj1E8fIRvldSxFSm4XfzE6qRRuHAT2a82fxprZRZl1yG2GwnImGmhuKH5hSyjPpzjA==";
      };

It does not, however, use node or npm to bring required stuff to your machine (my definition of "install"), everything passes by nix.

If you mean that "running elm-test requires node packages", then yes, I agree, no other solution at the moment.

JorelAli commented 4 years ago

@JorelAli maybe we use different definitions of the word "install". Nix indeed uses npm registry to fetch required packages

Apologies, my wording was off. I am referring to the fact that elm-test requires node packages to run.

If you mean that "running elm-test requires node packages", then yes, I agree, no other solution at the moment.

Thanks for the clarification!

harrysarson commented 4 years ago

Closing as I think this question now has an answer!