diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 47f70b8d..19bcc28f 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -32,6 +32,9 @@ jobs: uses: DeLaGuardo/setup-clojure@3.1 with: lein: 2.9.5 + - name: Install dependencies + run: | + npm ci - name: Run tests run: ./scripts/test.sh clj diff --git a/test/cljc/reitit/ring_coercion_test.cljc b/test/cljc/reitit/ring_coercion_test.cljc index ec2bd1fe..0a1c6503 100644 --- a/test/cljc/reitit/ring_coercion_test.cljc +++ b/test/cljc/reitit/ring_coercion_test.cljc @@ -652,12 +652,14 @@ :uri "/foo" :muuntaja/request {:format request-format} :muuntaja/response {:format response-format} - :body-params body})] + :body-params body}) + normalize-json (fn[body] + (-> body j/write-value-as-string (j/read-value j/keyword-keys-object-mapper)))] (testing "succesful call" - (is (= {:status 200 :body {:request :json, :response :json}} - (call (request "application/json" "application/json" {:request :json :response :json})))) - (is (= {:status 200 :body {:request :edn, :response :json}} - (call (request "application/edn" "application/json" {:request :edn :response :json})))) + (is (= {:status 200 :body {:request "json", :response "json"}} + (normalize-json (call (request "application/json" "application/json" {:request :json :response :json}))))) + (is (= {:status 200 :body {:request "edn", :response "json"}} + (normalize-json (call (request "application/edn" "application/json" {:request :edn :response :json}))))) (is (= {:status 200 :body {:request :default, :response :default}} (call (request "application/transit" "application/transit" {:request :default :response :default}))))) (testing "request validation fails" diff --git a/test/cljc/reitit/swagger_test.clj b/test/cljc/reitit/swagger_test.clj index 40902704..0ad096c7 100644 --- a/test/cljc/reitit/swagger_test.clj +++ b/test/cljc/reitit/swagger_test.clj @@ -161,14 +161,14 @@ expected {:x-id #{::math} :swagger "2.0" :info {:title "my-api"} - :definitions {::req-key {:type "string" + :definitions {"reitit.swagger-test/req-key" {:type "string" :x-anyOf [{:type "string"} {:type "string"}]} - ::req-val {:type "object" + "reitit.swagger-test/req-val" {:type "object" :x-anyOf [{:type "object"} {:type "string"}]} - ::resp-map {:type "object"}, - ::resp-string {:type "string" + "reitit.swagger-test/resp-map" {:type "object"}, + "reitit.swagger-test/resp-string" {:type "string" :minLength 1}} :paths {"/api/spec/plus/{z}" {:patch {:parameters [] :summary "patch"