         sb (s/system-builder [[:a identity {:a-arg [:foo]}]
                               [:b ff {:b-arg [:a :a-arg]}]])
         sys (s/start-system! sb {:foo 10})
-        _ (s/stop-system! sys)]
+        sysmap (s/system-map sys)
+        stop-sys (s/stop-system! sys)]
 
     (testing "dependent items are created"
-      (is (= @(s/system-map sys)
-             {:foo 10
-              :a {:a-arg 10}
-              :b {:b-arg 10}})))
+      #?(:clj
+         (is (= @(s/system-map sys)
+                {:foo 10
+                 :a {:a-arg 10}
+                 :b {:b-arg 10}}))))
 
     (testing "dependent items were destroyed"
-      (is (= @destructor-vals
-             [{:b-arg 10}])))))
+      #?(:clj
+         (is (= @destructor-vals
+                [{:b-arg 10}]))))))
 
 (deftest composed-builders
   (let [destructor-vals (atom [])

        sb (s/system-builder [[:a ff {:a-arg [:foo]}]
                              [:b ff {:b-arg [:a :a-arg]}]])
        sys (s/start-system! sb {:foo 10})
        _ (s/stop-system! sys)]

    (testing "dependent items are created"
      (is (= @(s/system-map sys)
             {:foo 10
              :a {:a-arg 10}
              :b {:b-arg 10}})))

    (testing "dependent items were destroyed"
      (is (= @destructor-vals
             [{:b-arg 10}
              {:a-arg 10}])))))

(deftest dependent-item-system-specified-out-of-order
  (let [destructor-vals (atom [])

        sb2 (s/system-builder sb [[:c ff {:c-a [:a :a-arg]
                                          :c-b [:b :b-arg]}]])
        sys (s/start-system! sb2 {:foo 10})
        sysmap (s/system-map sys)
        stop-sys (s/stop-system! sys)]

    (testing "items are created"
      #?(:clj
         (is (= @(s/system-map sys)
                {:foo 10
                 :a {:a-arg 10}
                 :b {:b-arg 10}
                 :c {:c-a 10 :c-b 10}}))))

    (testing "items were destroyed"
      #?(:clj
         (do
           @stop-sys
           (is (= @destructor-vals
                  [{:c-a 10 :c-b 10}
                   {:a-arg 10}])))))))

(deftest unwind-on-builder-error
  (let [destructor-vals (atom [])
