Skip to content

Commit d352b27

Browse files
committed
Add test
1 parent f2846d2 commit d352b27

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/lambdaisland/fetch_test.cljs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
(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]))
78

89
;; cd test_server
910
;; clj -X:run
@@ -80,3 +81,10 @@
8081
(p/let [res (fetch/get "http://localhost:9999/echo?x=y")]
8182
(is (= {"x" "y"} (get-in res [:body :params]))))])
8283
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))))

0 commit comments

Comments
 (0)