Skip to content
A mocking library for Clojure.
Branch: master
Clone or download
philomates Clojurescript support (#7)
* initial clojurescript adaptation; some tests failing

* fix format related issues

* get around unbound var limitations in cljs

* changelog / version bump

* PR feedback

* Mention Clojurescript in readme

* update test to work w/ cljs

* add release date
Latest commit 8f79a3f Mar 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
doc Add calling-original return (#6) Mar 13, 2019
src/mockfn Clojurescript support (#7) Mar 13, 2019
test/mockfn Clojurescript support (#7) Mar 13, 2019
.gitignore Create project. Nov 2, 2017
CHANGELOG.md
LICENSE
README.md
project.clj Clojurescript support (#7) Mar 13, 2019

README.md

mockfn

mockfn is a Clojure(script) library supporting mockist test-driven-development in Clojure. It is meant to be used alongside a regular testing framework such as clojure.test.

Clojars Project

CircleCI

Usage

The providing macro replaces a function with a configured mock.

(deftest providing-test
  (providing
    [(one-fn) :mocked]
    (is (= :mocked (one-fn)))))

The verifying macro works similarly, but also defines an expectation for the number of times a call should be performed during the test.

(deftest verifying-test
  (verifying
    [(one-fn) :mocked (at-least 1)]
    (is (= :mocked (one-fn)))))

Refer to the documentation for more detailed information, including:

License

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

You can’t perform that action at this time.