diff --git a/project.clj b/project.clj index 7e2ecbd0..cf4c7e18 100644 --- a/project.clj +++ b/project.clj @@ -25,7 +25,7 @@ :optimizations :advanced :source-map "target/advanced/datomish.js.map" :pretty-print true - :recompile-dependents false + :recompile-dependents true :parallel-build true }} :test { @@ -35,7 +35,7 @@ :main datomish.test :optimizations :none :source-map true - :recompile-dependents false + :recompile-dependents true :parallel-build true :target :nodejs }} diff --git a/src/datomish/promise_sqlite.cljs b/src/datomish/promise_sqlite.cljs index 1aff74a7..539fd5da 100644 --- a/src/datomish/promise_sqlite.cljs +++ b/src/datomish/promise_sqlite.cljs @@ -30,7 +30,7 @@ (.close (.-db db))))) (defn open - [path & {:keys [mode] :or {:mode 6}}] + [path & {:keys [mode] :or {mode 6}}] (cljs-promises.async/pair-port (-> (.open sqlite.DB path (clj->js {:mode mode})) diff --git a/src/datomish/test_macros.cljc b/src/datomish/test_macros.cljc index 1f71e78c..3145695d 100644 --- a/src/datomish/test_macros.cljc +++ b/src/datomish/test_macros.cljc @@ -3,7 +3,8 @@ ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. (ns datomish.test-macros - (:refer-clojure :exclude [with-open]) + #?(:cljs + (:require-macros [datomish.test-macros])) (:require [datomish.pair-chan])) @@ -29,42 +30,10 @@ (cljs.test/async done# (-> (datomish.pair-chan/go-pair ~@body) - (cljs.core.async/take! (fn [v# e#] + (cljs.core.async/take! (fn [[v# e#]] (cljs.test/is (= e# nil)) (done#)))))) (clojure.test/deftest ~(with-meta name {:async true}) (let [[v# e#] (clojure.core.async/ [name init ...] - Evaluates body in a try expression with names bound to the values - of the inits, and a finally clause that calls (.close name) on each - name in reverse order." - {:added "1.0"} - [bindings & body] - (assert-args - (vector? bindings) "a vector for its binding" - (even? (count bindings)) "an even number of forms in binding vector") - (cond - (= (count bindings) 0) `(do ~@body) - (symbol? (bindings 0)) `(let ~(subvec bindings 0 2) - (try - (with-open ~(subvec bindings 2) ~@body) - (finally - (. ~(bindings 0) close)))) - :else (throw (java.lang.IllegalArgumentException. - "with-open only allows Symbols in bindings")))) diff --git a/test/datomish/jdbc_sqlite_test.clj b/test/datomish/jdbc_sqlite_test.clj index be268016..21b7c068 100644 --- a/test/datomish/jdbc_sqlite_test.clj +++ b/test/datomish/jdbc_sqlite_test.clj @@ -14,35 +14,40 @@ (deftest-async test-all-rows (with-tempfile [t (tempfile)] - (with-open [db (