Liking cljdoc? Tell your friends :D

lazytest.experimental.interfaces.clojure-test

EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at https://github.com/noahtheduke/lazytest/issues

An adaption of the built-in clojure.test framework. testing works the same way as [[clojure.test/testing]], so it does not support metadata selection like lazytest.core/describe.

Supported [[clojure.test]] vars:

Example:

(ns noahtheduke.example-test
  (:require
   [lazytest.experimental.interfaces.clojure-test :refer [deftest are is testing]]))

(deftest deftest-test
  (is true "expect works inside")
  (testing "testing works"
    (is (= 7 (+ 3 4)) "is works"))
  (testing "are works"
    (are [x y] (= x y)
      2 (+ 1 1)
      4 (* 2 2))))
EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at https://github.com/noahtheduke/lazytest/issues

An adaption of the built-in `clojure.test` framework. [[testing]] works the same way as [[clojure.test/testing]], so it does not support metadata selection like [[lazytest.core/describe]].

Supported [[clojure.test]] vars:
* [[deftest]]
* [[testing]]
* [[is]]
* [[are]]

Example:
```clojure
(ns noahtheduke.example-test
  (:require
   [lazytest.experimental.interfaces.clojure-test :refer [deftest are is testing]]))

(deftest deftest-test
  (is true "expect works inside")
  (testing "testing works"
    (is (= 7 (+ 3 4)) "is works"))
  (testing "are works"
    (are [x y] (= x y)
      2 (+ 1 1)
      4 (* 2 2))))
```
raw docstring

lazytest.experimental.interfaces.midje

EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at https://github.com/noahtheduke/lazytest/issues.

An adaption of the Midje framework. Only adapts the fact and facts macros. fact acts like lazytest.core/it for the purposes of test-cases.

Unlike Midje, facts is not an alias for fact, and fact not support the (given => expected) syntax as that's highly complex and outside the scope of this namespace.

prep-ns-suite! must be called before facts, as they expect :lazytest/ns-suite to point to an existing suite.

Example:

(ns noahtheduke.example-test
  (:require
   [lazytest.experimental.interfaces.midje :refer [prep-ns-suite! facts fact]]))

(prep-ns-suite!)

(facts "a simple top level test"
  (fact "a test case"
    (expect true "expect works inside"))
  (facts "a nested facts call"
    (fact "this still works"
      (expect true))))
EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at <https://github.com/noahtheduke/lazytest/issues>.

An adaption of the [Midje](https://github.com/marick/midje) framework. Only adapts the [[fact]] and [[facts]] macros. [[fact]] acts like [[lazytest.core/it]] for the purposes of test-cases.

Unlike Midje, [[facts]] is not an alias for [[fact]], and [[fact]] not support the `(given => expected)` syntax as that's highly complex and outside the scope of this namespace.

[[prep-ns-suite!]] must be called before [[facts]], as they expect `:lazytest/ns-suite` to point to an existing suite.

Example:
```clojure
(ns noahtheduke.example-test
  (:require
   [lazytest.experimental.interfaces.midje :refer [prep-ns-suite! facts fact]]))

(prep-ns-suite!)

(facts "a simple top level test"
  (fact "a test case"
    (expect true "expect works inside"))
  (facts "a nested facts call"
    (fact "this still works"
      (expect true))))
```
raw docstring

lazytest.experimental.interfaces.qunit

EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at https://github.com/noahtheduke/lazytest/issues.

An adaption of the QUnit framework. Only adapts the unnested style as the nested style can be achieved natively with lazytest.core macros.

prep-ns-suite! must be called before module! or test!, as they expect :lazytest/ns-suite to point to an existing suite.

Example:

(ns noahtheduke.example-test
  (:require
   [lazytest.interfaces.qunit :refer [prep-ns-suite! module! test! assert!]]))

(prep-ns-suite!)

(module! "Group A")

(test! "foo"
  (assert! (true? (pos? 1)))
  (assert! (false? (pos? 0)) "Expected to be false"))
EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at <https://github.com/noahtheduke/lazytest/issues>.

An adaption of the [QUnit](https://qunitjs.com/) framework. Only adapts the unnested style as the nested style can be achieved natively with [[lazytest.core]] macros.

[[prep-ns-suite!]] must be called before [[module!]] or [[test!]], as they expect `:lazytest/ns-suite` to point to an existing suite.

Example:

```clojure
(ns noahtheduke.example-test
  (:require
   [lazytest.interfaces.qunit :refer [prep-ns-suite! module! test! assert!]]))

(prep-ns-suite!)

(module! "Group A")

(test! "foo"
  (assert! (true? (pos? 1)))
  (assert! (false? (pos? 0)) "Expected to be false"))
```
raw docstring

lazytest.experimental.interfaces.xunit

EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at https://github.com/noahtheduke/lazytest/issues.

An adaption of the xUnit style of test frameworks. A fairly simple aliasing of the lazytest.core macros:

Example:

(ns noahtheduke.example-test
  (:require
   [lazytest.experimental.interfaces.xunit :refer [defsuite suite test-case assert!]]))

(defsuite defsuite-test
  (suite "defsuite works"
    (assert! true "expect works inside"))
  (suite "suite works"
    (test-case "test-case works"
      (assert! true))))
EXPERIMENTAL. COULD BE CHANGED AT ANY TIME. Please share usage reports at <https://github.com/noahtheduke/lazytest/issues>.

An adaption of the [xUnit](https://en.wikipedia.org/wiki/XUnit) style of test frameworks. A fairly simple aliasing of the [[lazytest.core]] macros:

* [[lazytest.core/defdescribe]] -> [[defsuite]]
* [[lazytest.core/describe]] -> [[suite]]
* [[lazytest.core/it]] -> [[test-case]]
* [[lazytest.core/expect]] -> [[assert!]]

Example:

```clojure
(ns noahtheduke.example-test
  (:require
   [lazytest.experimental.interfaces.xunit :refer [defsuite suite test-case assert!]]))

(defsuite defsuite-test
  (suite "defsuite works"
    (assert! true "expect works inside"))
  (suite "suite works"
    (test-case "test-case works"
      (assert! true))))
```
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close