Yokai

Hex.pmDownloadsDocumentation

Yokai is an alternative test runner for ExUnit base on file watcher. Watchs for code changes and changes in the selected test files to auto trigger a new testa run hot reloading the code avoiding a cold start of the app/vm. The BEAM way.

Installation

# You need this to mix watch apply MIX_ENV=test for you.
def cli do
  [
    preferred_envs: [{:watch, :test}]
  ]
end

def deps do
  [
    {:yokai, "~> 0.3.1"}
  ]
end

Usage

# Run all tests and watch for changes
mix watch

# Run only this test file and watch for changes
mix watch test/module_name.exs

# Run all tests following a wildcard pattern
mix watch test/domain/*

# Increate the compile timeout for big projects.
mix watch --compile-timeout 60

Reason

The point is to have a faster iteration for then developing test/changes or applying TDD.

When talking about this idea it always come up that you need to reload the environment when you change a config. And to this there is 2 points against.

Goals

Have a fast code reloader and a nice CLI to quick iterate on development.