Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Write unit and fuzz tests for Elm code.

When people say “elm-test” they usually refer to either:

- This Elm package for writing tests.
- [rtfeldman/node-test-runner](https://github.com/rtfeldman/node-test-runner) – a CLI tool (called `elm-test`) for running tests defined using this package in the terminal.

## Quick Start

Here are three example tests:
Expand Down Expand Up @@ -46,27 +51,15 @@ This code uses a few common functions:

Check out [a large real-world test suite](https://github.com/rtfeldman/elm-css/tree/master/tests) for more.

### Running tests locally

Here's how to set up and run your tests using the [CLI test runner](https://github.com/rtfeldman/node-test-runner):

1. Run `npm install -g elm-test` if you haven't already.
2. `cd` into the project's root directory that has your `elm.json`.
3. Run `elm-test init`. It will create a `tests` directory inside this one,
with some files in it.
5. Run `elm-test`.
6. Edit `tests/Example.elm` to introduce new tests.

Hint: If you have dependencies add them via `elm-test install authorName/dependencyName`.
Tip! Run [elm-test init](https://github.com/rtfeldman/node-test-runner#init) to generate some example tests to get you started.

Bonus hint: Run `elm-test --watch` to rerun your tests whenever a file is saved.
### Running tests

### Running tests on CI
This package lets you define tests ([Test](https://package.elm-lang.org/packages/elm-explorations/test/latest/Test#Test) values).

Here are some examples of running tests on CI servers:
To execute your tests and see if they pass you need a program that can consume your tests, run them and report the results.

* [`travis.yml`](https://github.com/rtfeldman/elm-css/blob/master/.travis.yml)
* [`appveyor.yml`](https://github.com/rtfeldman/elm-css/blob/master/appveyor.yml)
The most popular test runner is [rtfeldman/node-test-runner](https://github.com/rtfeldman/node-test-runner). It’s a CLI tool that lets you run tests in the terminal. Head over to that project for instructions on how to get started!

### Not running tests

Expand Down