         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"
-      (is (= @(s/system-map sys)
-             {:foo 10
-              :a {:a-arg 10}
-              :b {:b-arg 10}
-              :c {:c-a 10 :c-b 10}})))
+      #?(: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"
-      @(s/stop-system! sys)
-      (is (= @destructor-vals
-             [{:c-a 10 :c-b 10}
-              {:a-arg 10}])))))
+      #?(: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 [])


(deftest empty-system
  (let [sb (s/system-builder [])
        sys (s/start-system! sb {:foo 10})]

    (testing "null system contains config"
      #?(:clj (is (= (first @sys) {:foo 10}))

         :cljs
         (t/async
          done
          (p/then
           sys
           (fn [v]
             (t/is (= (first v) {:foo 10}))
             (done))))))))

(deftest empty-system-stops
  (let [sb (s/system-builder [])
        sys (s/start-system! sb {:foo 10})
        _ (s/stop-system! sys)]

    (testing "null system has no managed objects"
      #?(:clj

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

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

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

(deftest composed-builders
  (let [destructor-vals (atom [])
