From f601f272d43f69d2b0d9cef683eda35400bc0047 Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Mon, 12 Oct 2020 12:19:31 -0700 Subject: [PATCH] Tests pass. --- .../lemondronor/advisorycircular_test.cljs | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/test/lemondronor/advisorycircular_test.cljs b/src/test/lemondronor/advisorycircular_test.cljs index 916a74c..c80cb1e 100644 --- a/src/test/lemondronor/advisorycircular_test.cljs +++ b/src/test/lemondronor/advisorycircular_test.cljs @@ -398,22 +398,19 @@ (let [a1 {:properties {:distance 1.5 :label "Bridge heliport"}} a2 {:properties {:distance 0.5 :label "New York Seaport"}} a3 {:properties {:distance 1.0 :label "LAX"}} - nearby (fn [config lat lon options] + nearby (fn [_config _lat _lon _options] {:features [a1 a2 a3]})] + ;; This is pretty hacky, but. + (set! pelias/nearby nearby) + (println (nearby 1 2 3 4)) (async done (p/do (testing "closest-airport 1" - ;; Note that the with-redefs only works for the first - ;; binding clause in p/let. - (with-redefs [pelias/nearby nearby] - (p/let [r (advisorycircular/closest-airport {} 0 0)] - (is (= r a2))))) + (p/let [r (advisorycircular/closest-airport {} 0 0)] + (is (= r a2)))) (testing "closest-airport with blocklist" - (with-redefs [pelias/nearby nearby] - (let [conf {:airport {:blocklist ["seaport"]}}] - (p/let [r (advisorycircular/closest-airport conf 0 0)] - (is (= r a3)))))) - (done)) - - ))) + (let [conf {:airport {:blocklist ["seaport"]}}] + (p/let [r (advisorycircular/closest-airport conf 0 0)] + (is (= r a3))))) + (done)))))