   #?(:cljs
      (t/async done
        (let [value (volatile! nil)
-             c1 (p/schedule 1000 #(vreset! value 1))
-             c2 (p/schedule 1000 #(vreset! value 2))]
+             c1 (p/schedule 100 #(vreset! value 1))
+             c2 (p/schedule 100 #(vreset! value 2))]
          (p/cancel! c1)
-         (p/schedule 1200
+         (p/schedule 300
                      (fn []
                        (t/is (= @value 2))
                        (t/is (realized? c2))

(t/deftest arbitrary-choice-with-any
  #?(:cljs
     (t/async done
       (let [p1 (p/any [(p/delay 300 1) (p/delay 200 2)])]
         (p/then p1 (fn [v]
                      (t/is (= v 2))
                      (done)))))
     :clj
     (let [p1 (p/any [(p/delay 300 1) (p/delay 200 2)])]
       (t/is (= @p1 2)))))

(t/deftest reject-promise-in-chain

(t/deftest chaining-using-chain
  #?(:cljs
     (t/async done
       (let [p1 (future-ok 100 2)
             p2 (p/chain p1 inc inc inc)]
         (p/then p2 (fn [v]
                      (t/is (= v 5))
                      (done)))))
     :clj
     (let [p1 (future-ok 100 2)
           p2 (p/chain p1 inc inc inc)]
       (t/is (= @p2 5)))))

(t/deftest branching-using-branch-1
  #?(:cljs
     (t/async done
       (let [p1 (future-ok 100 2)
             p2 (p/branch p1 #(inc %) (constantly nil))]
         (p/then p2 #(do
                       (t/is (= % 3))
                       (done)))))
     :clj
     (let [p1 (future-ok 100 2)
           p2 (p/branch p1 #(inc %) (constantly nil))]
       (t/is (= @p2 3)))))

