Skip to content
Runs elm-test suites from Node.js. Get it with npm install -g elm-test
Branch: master
Clone or download
Latest commit f440c1b Mar 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Move a bunch of stuff into lib/elm-test.js Jun 14, 2017
elm Separate elm src and add unit tests Feb 20, 2019
example-application-no-tests Use elm-explorations/test 1.2.0 everywhere Jan 18, 2019
example-application Use elm-explorations/test 1.2.0 everywhere Jan 18, 2019
example-package-no-tests Use elm-explorations/test 1.2.0 everywhere Jan 18, 2019
example-package Use elm-explorations/test 1.2.0 everywhere Jan 18, 2019
fixtures/elm-home/0.19.0/package Update fixtures Mar 11, 2019
lib Separate elm src and add unit tests Feb 20, 2019
templates Delete some obsolete templates Jan 18, 2019
tests
.flowconfig
.gitignore Rename example -> example-application Jul 19, 2018
.npmignore
.prettierignore
.travis.yml Remove node 6 from Travis-CI builds Nov 16, 2018
CHANGELOG.md Update Changelog Mar 11, 2019
LICENSE
README.md Update README Sep 5, 2018
appveyor.yml
elm.json Separate elm src and add unit tests Feb 20, 2019
package-lock.json Bump chokidar dep to fix npm audit Mar 11, 2019
package.json
prettier.config.js Configure prettier Oct 30, 2018

README.md

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

Runs elm-test suites from Node.js

Installation

npm install -g elm-test

Usage

elm-test install foo/bar # Install the foo/bar package to "test-dependencies"
elm-test init            # `elm-test install elm-explorations/test` and create tests/Example.elm
elm-test                 # Run all exposed Test values in *.elm files in tests/
elm-test Foo.elm         # Run all exposed Test values in Foo.elm

Configuration

install

Like elm install, except it installs to the test-dependencies field of your project's elm.json file instead of dependencies.

elm-test install elm/regex

init

Runs elm-test install elm-explorations/test and then creates a tests/Example.elm example test to get you started.

Afterwards, you can run elm-test with no arguments to try out the example.

--compiler

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

--seed

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

--fuzz

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

elm-test --fuzz=500

--report

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

--version

Displays the version of the current elm-test.

$ elm-test --version
0.19.0

--watch

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

--help

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

cache:
  directories:
    - elm-stuff/build-artifacts
    - elm-stuff/packages
    - sysconfcpus
os:
  - linux

env: ELM_VERSION=0.19.0

before_install:
  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config

install:
  - node --version
  - npm --version
  - npm install -g elm@$ELM_VERSION elm-test
  # Faster compile on Travis.
  - |
    if [ ! -d sysconfcpus/bin ];
    then
      git clone https://github.com/obmarg/libsysconfcpus.git;
      cd libsysconfcpus;
      ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
      make && make install;
      cd ..;
    fi

script:
  - $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 1 elm-test
You can’t perform that action at this time.