Fast Clojure.test runner for Boot and Leiningen
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Update eftest Dec 17, 2018
.gitignore Add start & end hooks Aug 30, 2016
CHANGELOG.md Update eftest Dec 17, 2018
CONTRIBUTING.md Release 0.1.0 May 23, 2016
README.md README.md: :json -> :junit Mar 14, 2018
boot.properties Update eftest and release 0.4.1 Dec 14, 2018
build.boot Update eftest Dec 17, 2018
screenshot.png Initial commit May 16, 2016

README.md

Bat-test Clojars Project

Formerly known as Boot-alt-test

Fast Clojure.test runner for Boot and Leiningen.

Features

  • Requires tools.namespace 0.3.0-alpha3
  • Uses eftest to display pretty reports
    • Can optionally run tests parallel
    • Can capture output and display the output just for the failing tests (:capture-output?, enabled by default)
    • Can be configured to stop running tests after the first failure (:fail-fast?)
  • Easy way to setup and combine eftest reporters:
    • Built-in reporters can be referred by keywords :pretty, :progress and :junit
    • Reporter can be map with :type (referring to reporter fn) and option :output-to which will redirect the output to a file.
    • Multiple reporters can be combined when defining them as vector: (bat-test :report [:pretty {:type :junit :output-to "target/junit.xml"}])
  • Uses clojure.tools.namespace to reload changed namespaces and to run only the tests in changed or affected namespaces
  • Tries to recover from namespace reload errors so that no process restart is needed
    • This means that after some exceptions all the namespaces have to reloaded
    • Related: (CTN-6, CTN-24)
  • Run all tests by hitting enter
  • Two hooks to manage the test environment
    • on-start hook: run a function before any tests are run
    • on-end hook: run a function after all tests are run
  • Cloverage integration
    • cloverage-opts option to set (subset) of Cloverage options
    • boot bat-test -c or lein bat-test cloverage
    • Probably doesn't work well together with watch task

Screenshot

Leiningen features

  • Built-in file change watcher
  • Copies lein-test API, e.g. test-selectors:
    • lein bat-test :only namespace/test-var
    • lein bat-test only-this-namespace
    • lein bat-test :integration
  • :notify-command for calling notify-send or Growl or such

Boot Usage

  1. Add [metosin/bat-test "X.X.X" :scope "test"] as a dependency in your build.boot

  2. Add (require '[metosin.bat-test :refer (bat-test)]) somewhere in your build.boot to make the task available to your Boot workflow.

  3. Run boot bat-test at the command-line or (boot (bat-test)) in the REPL, or add bat-test task as part of your Boot pipeline.

See boot bat-test -h for a list of available task options.

Lein Usage

  1. Add [metosin/bat-test "X.X.X"] as a plugin in your project.clj

  2. Add options under :bat-test key in project map and run lein bat-test at the command-line

See lein bat-test help for a list of available task options.

License

Copyright © 2016-2018 Metosin Oy

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.