mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 00:41:12 +00:00
Test fix, silence extra cljs warnings
This commit is contained in:
parent
bf82533028
commit
0a7b50a730
2 changed files with 16 additions and 9 deletions
|
|
@ -8,13 +8,19 @@
|
||||||
:output-to "target/shadow-node-test/node-tests.js"
|
:output-to "target/shadow-node-test/node-tests.js"
|
||||||
:ns-regexp "-test"
|
:ns-regexp "-test"
|
||||||
;; Watch will also run the tests
|
;; Watch will also run the tests
|
||||||
:autorun true}
|
:autorun true
|
||||||
|
:compiler-options {:warnings {:redef-in-file false
|
||||||
|
:fn-deprecated false}}}
|
||||||
|
|
||||||
:browser-test
|
:browser-test
|
||||||
{:target :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
|
:karma
|
||||||
{:target :karma
|
{:target :karma
|
||||||
:output-to "target/karma/ci.js"
|
:output-to "target/karma/ci.js"
|
||||||
:ns-regexp "-test$"}}}
|
:ns-regexp "-test$"
|
||||||
|
:compiler-options {:warnings {:redef-in-file false
|
||||||
|
:fn-deprecated false}}}}}
|
||||||
|
|
|
||||||
|
|
@ -49,22 +49,23 @@
|
||||||
(fn [match history]
|
(fn [match history]
|
||||||
(let [url (rfh/-get-path history)]
|
(let [url (rfh/-get-path history)]
|
||||||
(case (swap! n inc)
|
(case (swap! n inc)
|
||||||
1 (do (is (= "/" url)
|
1 (rfh/push-state history ::frontpage)
|
||||||
|
2 (do (is (= "/" url)
|
||||||
"start at root")
|
"start at root")
|
||||||
(rfh/push-state history ::foo))
|
(rfh/push-state history ::foo))
|
||||||
2 (do (is (= "/foo" url)
|
3 (do (is (= "/foo" url)
|
||||||
"push-state")
|
"push-state")
|
||||||
(.back js/window.history))
|
(.back js/window.history))
|
||||||
3 (do (is (= "/" url)
|
4 (do (is (= "/" url)
|
||||||
"go back")
|
"go back")
|
||||||
(rfh/push-state history ::bar {:id 1}))
|
(rfh/push-state history ::bar {:id 1}))
|
||||||
4 (do (is (= "/bar/1" url)
|
5 (do (is (= "/bar/1" url)
|
||||||
"push-state 2")
|
"push-state 2")
|
||||||
(rfh/replace-state history ::bar {:id 2}))
|
(rfh/replace-state history ::bar {:id 2}))
|
||||||
5 (do (is (= "/bar/2" url)
|
6 (do (is (= "/bar/2" url)
|
||||||
"replace-state")
|
"replace-state")
|
||||||
(.back js/window.history))
|
(.back js/window.history))
|
||||||
6 (do (is (= "/" url)
|
7 (do (is (= "/" url)
|
||||||
"go back after replace state")
|
"go back after replace state")
|
||||||
(rfh/stop! history)
|
(rfh/stop! history)
|
||||||
(done))
|
(done))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue