This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-11
Channels
- # aws (6)
- # beginners (105)
- # boot (6)
- # cider (50)
- # cljsrn (10)
- # clojure (41)
- # clojure-brasil (6)
- # clojure-italy (25)
- # clojure-nl (17)
- # clojure-russia (4)
- # clojure-serbia (1)
- # clojure-spec (8)
- # clojure-uk (242)
- # clojurescript (27)
- # core-async (10)
- # cursive (5)
- # data-science (9)
- # datomic (43)
- # emacs (6)
- # fulcro (6)
- # graphql (1)
- # javascript (3)
- # juxt (4)
- # lein-figwheel (1)
- # mount (1)
- # onyx (19)
- # parinfer (2)
- # portkey (15)
- # protorepl (1)
- # re-frame (30)
- # reagent (3)
- # ring-swagger (1)
- # shadow-cljs (22)
- # sql (6)
- # tools-deps (23)
- # vim (13)
Hi, I have a unit test where I'm trying to swap a state with a mock (of a class). However, this state doesn't get swapped and retains its original value.
(use-fixtures
:once
(fn [f]
(-> (mount/only #{#'http-server.config/env
#'http-server.generator.core/generator
#'http-server.db.core/*db*
#'http-server.handler/app})
(mount/swap-states {#'http-server.generator.core/generator {:start #(MockGenerator.)}})
mount/start)
(f)
(mount/stop)))
Any idea what's wrong with this code?