Test fix, silence extra cljs warnings

This commit is contained in:
Juho Teperi 2025-01-22 12:09:14 +02:00
parent bf82533028
commit 0a7b50a730
2 changed files with 16 additions and 9 deletions

View file

@ -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}}}}}

View file

@ -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))