mirror of
https://github.com/metosin/reitit.git
synced 2025-12-30 13:18:25 +00:00
Update sieppari, fix tests
This commit is contained in:
parent
6777cb8620
commit
b1c8dbdaa4
3 changed files with 9 additions and 9 deletions
|
|
@ -32,7 +32,7 @@
|
|||
[metosin/schema-tools "0.12.2"]
|
||||
[metosin/muuntaja "0.6.7"]
|
||||
[metosin/jsonista "0.2.6"]
|
||||
[metosin/sieppari "0.0.0-alpha9"]
|
||||
[metosin/sieppari "0.0.0-alpha10"]
|
||||
[metosin/malli "0.0.1-20200404.091302-14"]
|
||||
|
||||
;; https://clojureverse.org/t/depending-on-the-right-versions-of-jackson-libraries/5111
|
||||
|
|
|
|||
|
|
@ -294,24 +294,24 @@
|
|||
{:executor sieppari/executor})]
|
||||
(let [respond (promise)]
|
||||
(app {:request-method :get, :uri "/ping"} respond ::irrelevant)
|
||||
(is (= response @respond))))))
|
||||
(is (= response (deref respond 100 ::timeout)))))))
|
||||
|
||||
(defrecord MyAsyncContext [])
|
||||
|
||||
(deftest unknown-async-test
|
||||
(testing "works if registered"
|
||||
(require '[sieppari.async.core-async])
|
||||
(let [response {:status 200, :body "ok"}
|
||||
app (http/ring-handler
|
||||
(http/router
|
||||
["/ping" {:get {:interceptors [{:enter map->MyAsyncContext}]
|
||||
:handler (fn [_] response)}}])
|
||||
(ring/create-default-handler)
|
||||
{:executor sieppari/executor})]
|
||||
(let [raise (promise)]
|
||||
(app {:request-method :get, :uri "/ping"} ::irrelevant raise)
|
||||
(let [response' @raise]
|
||||
(is (instance? ExceptionInfo response')))))))
|
||||
{:executor sieppari/executor})
|
||||
respond (promise)
|
||||
raise (promise)]
|
||||
(app {:request-method :get, :uri "/ping"} respond raise)
|
||||
(let [raised (deref raise 100 ::timeout)]
|
||||
(is (instance? ExceptionInfo raised))))))
|
||||
|
||||
(deftest interceptor-transform-test
|
||||
(let [interceptor (fn [name] {:name name
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
500 {:description "fail"}}
|
||||
:summary "plus"}
|
||||
:post {:parameters [{:in "body",
|
||||
:name "",
|
||||
:name "body",
|
||||
:description "",
|
||||
:required false,
|
||||
:schema {:type "array",
|
||||
|
|
|
|||
Loading…
Reference in a new issue