File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
(ns lambdaisland.fetch-test
2
- (:require [applied-science.js-interop :as j]
3
- [clojure.pprint :as pprint]
4
- [clojure.test :refer [deftest testing is are use-fixtures run-tests join-fixtures async]]
5
- [kitchen-async.promise :as p]
6
- [lambdaisland.fetch :as fetch]))
2
+ (:require
3
+ [applied-science.js-interop :as j]
4
+ [clojure.pprint :as pprint]
5
+ [clojure.test :refer [deftest testing is are use-fixtures run-tests join-fixtures async]]
6
+ [kitchen-async.promise :as p]
7
+ [lambdaisland.fetch :as fetch]))
7
8
8
9
; ; cd test_server
9
10
; ; clj -X:run
80
81
(p/let [res (fetch/get " http://localhost:9999/echo?x=y" )]
81
82
(is (= {" x" " y" } (get-in res [:body :params ]))))])
82
83
done)))
84
+
85
+ (deftest explicit-response-type
86
+ (async
87
+ done
88
+ (p/let [res (fetch/get " http://localhost:9999/hello" {:accept :json :as :text })]
89
+ (is (= " {\" hello\" :\" world\" }" (:body res)))
90
+ (done ))))
You can’t perform that action at this time.
0 commit comments