Runs elm-test suites from Node.js. Get it with npm install -g elm-test
JavaScript Elm
rtfeldman Merge pull request #262 from ento/compile-error-visibility
Display elm-make's error message when it fails to compile when using a machine readable reporter
Latest commit e446262 Jul 9, 2018

node-test-runner Version Travis build Status AppVeyor Build status

Runs elm-test suites from Node.js


npm install -g elm-test


elm-test init    # Adds the elm-test dependency and creates a suitable folder structure
elm-test         # Runs all exposed Test values in *.elm files in the test/ and tests/ directories
elm-test Foo.elm # Runs all exposed Test values in Foo.elm

Running elm-test will also ensure that any dependencies in elm-package.json and tests/elm-package.json are installed before it runs the tests.



Initializes the recommended project setup for testable Elm. It will create a tests folder with an elm-package.json based on your project's main elm-package.json with elm-test dependencies added, add elm-stuff to a .gitignore file and make your elm-package.json point to the src/ folder.


The --compiler flag can be used to use a version of the Elm compiler that has not been installed globally.

npm install elm
elm-test --compiler ./node_modules/.bin/elm-make


Allow running the tests with a predefined seed, rather than a randomly generated seed. This is especially helpful when trying to reproduce a failing fuzz-test.

elm-test --seed=12345


Define how many times a fuzzer should run. Defaults to 100

elm-test --fuzz=500


Utility to add missing dependencies from the elm-package.json in the current directory to a target elm-package.json file. Helpful after adding a dependency to your application.

elm-test --add-dependencies tests/elm-package.json


Specify which reporter to use for reporting your test results. Valid options are:

  • console (default): pretty, human readable formatted output
  • json: every event will be written to stdout as a json-encoded object
  • junit: junit-compatible xml will be written to stdout
elm-test --report=json


Displays the version of the current elm-test.

$ elm-test --version


Starts the runner in watch mode. Upon changing any currently watched source files (either in your your source-directories or in your tests' source-directories), your tests will get rerun.

elm-test --watch


Displays all the available options and commands.

Travis CI

If you want to run your tests on Travis CI, here's a good starter .travis.yml:

sudo: false

language: node_js
node_js: node

    - elm-stuff/build-artifacts
    - elm-stuff/packages
    - sysconfcpus
  - linux

env: ELM_VERSION=0.18.0

  - echo -e "Host\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config

  - node --version
  - npm --version
  - npm install -g elm@$ELM_VERSION elm-test
  - git clone
  - elm-ops-tooling/with_retry.rb elm package install --yes
  # Faster compile on Travis.
  - |
    if [ ! -d sysconfcpus/bin ];
      git clone;
      cd libsysconfcpus;
      ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
      make && make install;
      cd ..;

  - cd tests && $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make --yes Tests.elm && cd ..

  - $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-test