Giter VIP home page Giter VIP logo

node-test-runner's Introduction

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 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

Configuration

init

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.

--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-make

--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

--add-dependencies

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

--report

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

  • chalk (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.18.4

--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.18.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
  - git clone https://github.com/NoRedInk/elm-ops-tooling
  - elm-ops-tooling/with_retry.rb elm package install --yes
  # 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

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

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

node-test-runner's People

Contributors

amitaibu avatar athaeryn avatar avh4 avatar bdukes avatar benansell avatar deadfoxygrandpa avatar eeue56 avatar ento avatar fapian avatar jessitron avatar jwoudenberg avatar knewter avatar lpil avatar mgold avatar petejohanson avatar prikhi avatar robertjlooby avatar rtfeldman avatar rundis avatar stoeffel avatar svrist avatar tgecho avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.