Skip to content

Commit

Permalink
Error tests only on clj
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkerlucio committed Aug 20, 2023
1 parent e822e30 commit c953f56
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions test/com/wsscode/pathom3/connect/operation_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@
:input {:x 1}
:env {:z 3}}))

(try
(apply resolver [{:z 3} {:x 1} {:not :ok}])
(is false "Error expected to be thrown")
(catch #?(:clj Throwable :cljs :default) e
(is (= (ex-message e) "Can't call resolver with more than 2 arguments."))
(is (= (ex-data e) {:args [{:z 3} {:x 1} {:not :ok}]}))))))
#?(:clj
(try
(apply resolver [{:z 3} {:x 1} {:not :ok}])
(is false "Error expected to be thrown")
(catch #?(:clj Throwable :cljs :default) e
(is (= (ex-message e) "Can't call resolver with more than 2 arguments."))
(is (= (ex-data e) {:args [{:z 3} {:x 1} {:not :ok}]})))))))

(testing "validates configuration map"
(try
Expand Down Expand Up @@ -185,12 +186,13 @@
:params {:x 1}
:env {:z 3}}))

(try
(apply resolver [{:z 3} {:x 1} {:not :ok}])
(is false "Error expected to be thrown")
(catch #?(:clj Throwable :cljs :default) e
(is (= (ex-message e) "Can't call mutation with more than 2 arguments."))
(is (= (ex-data e) {:args [{:z 3} {:x 1} {:not :ok}]}))))))
#?(:clj
(try
(apply resolver [{:z 3} {:x 1} {:not :ok}])
(is false "Error expected to be thrown")
(catch #?(:clj Throwable :cljs :default) e
(is (= (ex-message e) "Can't call mutation with more than 2 arguments."))
(is (= (ex-data e) {:args [{:z 3} {:x 1} {:not :ok}]})))))))

(testing "validates configuration map"
(try
Expand Down

0 comments on commit c953f56

Please sign in to comment.