Example projects

Sean Corfield - user manager

User manager has unit tests that also include an embedded database. Tests can run with the Cognitect Labs test runner.

:test alias includes the test path and a dependency for the H2 database

Cognitect Labs test runner included in the project deps.edn file as :runner

clojure -M:test:runner will run the Cogitect Labs runner and include the dependecy to run the in-menory database used for the tests.

Using koacha with Sean Corfield user manager

Adding a test.edn file is not sufficient for testing this project with lambdaisland/kaocha, as the H2 dependency is also needed.

Create a bin/koacha script and add the extra alias

#!/usr/bin/env bash
clojure -M:test:test-runner-kaocha "$@"

Status Monitor

Status monitor is a Leiningen project.

Include a :kaocha profile in the project.clj file, adding the koacha dependency. The :kaocha alias sets the main namespace and uses the kaocha profile.

{:dev    {:dependencies [[javax.servlet/servlet-api "2.5"]
                           [ring/ring-mock "0.3.2"]]}
   :kaocha {:dependencies [[lambdaisland/kaocha "1.0.632"]]}}
  :aliases {"kaocha" ["with-profile" "+kaocha" "run" "-m" "kaocha.runner"]}

lein kaocha will run all the tests

results matching ""

    No results matching ""