-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocking request? #13
Comments
Not sure if I want to go into the mocking business. |
omg I fogot that could work on clojurescript. Many thanks |
Btw, I think an example of |
It turns out that (ns my-ns.mock
(:refer-clojure :exclude [get])
(:require-macros [cljs.core.async.macros :refer [alt! go]])
(:require [cljs.core.async :as async :refer [put! chan <!]]))
(defn get [url]
(cond
(= "/some-url" url)
(let [c (chan)]
(go (put! c {:body sample-data}))
c))) In my main namespace: (:require ;; [cljs-http.client :as http] ;; => production
[omtoo.mock :as http] ;; => development
)
;; use http/get etc as usual Hope this will help somebody else. |
AngularJs comes with pretty handy mocking feature in their http api which is really convenient to develop
The text was updated successfully, but these errors were encountered: