                    (t/is (= v 3))
                    (done))))))
 
-
 (t/deftest promisify
   (t/async done
     (let [func1 (fn [x cb] (cb (inc x)))

                   (t/is (= (m/extract p1)  1))
                   (done))))))

(t/deftest spread-all-chain
  (let [p1 (-> (p/all [(p/promise 1) (p/promise 2)])
               (p/spread (fn [x y]
                           (t/is (= x 1))
                           (t/is (= y 2))
                           (+ x y))))]
    (p/then p1 (fn [v]
                 (t/is (= v 3))))))

(t/deftest any-with-delay-chain
  (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))))))

(t/deftest any-with-timeout-catch
  (t/async done
    (let [p1 (-> (p/delay 300 1)
                 (p/timeout 200))]

                             (t/is (instance? js/Error v))
                             (t/is (p/rejected? p1))
                             (done))))))

(t/deftest promise-as-functor
  (t/async done
