From 0a7b50a73021ea2b75f514773aae71a6cca13304 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Wed, 22 Jan 2025 12:09:14 +0200 Subject: [PATCH] Test fix, silence extra cljs warnings --- shadow-cljs.edn | 12 +++++++++--- test/cljs/reitit/frontend/history_test.cljs | 13 +++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index da69f14d..7a923072 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -8,13 +8,19 @@ :output-to "target/shadow-node-test/node-tests.js" :ns-regexp "-test" ;; Watch will also run the tests - :autorun true} + :autorun true + :compiler-options {:warnings {:redef-in-file false + :fn-deprecated false}}} :browser-test {:target :browser-test - :test-dir "target/shadow-browser-test"} + :test-dir "target/shadow-browser-test" + :compiler-options {:warnings {:redef-in-file false + :fn-deprecated false}}} :karma {:target :karma :output-to "target/karma/ci.js" - :ns-regexp "-test$"}}} + :ns-regexp "-test$" + :compiler-options {:warnings {:redef-in-file false + :fn-deprecated false}}}}} diff --git a/test/cljs/reitit/frontend/history_test.cljs b/test/cljs/reitit/frontend/history_test.cljs index ff3df965..4d3951be 100644 --- a/test/cljs/reitit/frontend/history_test.cljs +++ b/test/cljs/reitit/frontend/history_test.cljs @@ -49,22 +49,23 @@ (fn [match history] (let [url (rfh/-get-path history)] (case (swap! n inc) - 1 (do (is (= "/" url) + 1 (rfh/push-state history ::frontpage) + 2 (do (is (= "/" url) "start at root") (rfh/push-state history ::foo)) - 2 (do (is (= "/foo" url) + 3 (do (is (= "/foo" url) "push-state") (.back js/window.history)) - 3 (do (is (= "/" url) + 4 (do (is (= "/" url) "go back") (rfh/push-state history ::bar {:id 1})) - 4 (do (is (= "/bar/1" url) + 5 (do (is (= "/bar/1" url) "push-state 2") (rfh/replace-state history ::bar {:id 2})) - 5 (do (is (= "/bar/2" url) + 6 (do (is (= "/bar/2" url) "replace-state") (.back js/window.history)) - 6 (do (is (= "/" url) + 7 (do (is (= "/" url) "go back after replace state") (rfh/stop! history) (done))