From 4a9f3109372f1c543ec93d3b4f5dbe38b6cc601f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 29 Nov 2023 14:52:19 -0500 Subject: [PATCH] fix: upstream tests failing --- src/test/frontend/test/helper.cljs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test/frontend/test/helper.cljs b/src/test/frontend/test/helper.cljs index 002084c3d..8226beb4d 100644 --- a/src/test/frontend/test/helper.cljs +++ b/src/test/frontend/test/helper.cljs @@ -20,7 +20,7 @@ (defn start-test-db! [& {:as opts}] - (let [test-db (if (:db-graph? opts) + (let [test-db (if (or (:db-graph? opts) (some? js/process.env.DB_GRAPH)) test-db-name-db-version test-db-name)] (conn/start! test-db opts))) @@ -232,7 +232,10 @@ This can be called in synchronous contexts as no async fns should be invoked" connection when done with it." [f & {:as start-opts}] ;; Set current-repo explicitly since it's not the default - (state/set-current-repo! test-db-name-db-version) + (state/set-current-repo! + (if (or (:db-graph? start-opts) (some? js/process.env.DB_GRAPH)) + test-db-name-db-version + test-db-name)) (start-test-db! start-opts) (when-let [init-f (:init-data start-opts)] (assert (fn? f) "init-data should be a fn") @@ -243,9 +246,7 @@ This can be called in synchronous contexts as no async fns should be invoked" (defn db-based-start-and-destroy-db [f & {:as start-opts}] - (set! test-db "logseq_db_test-db") - (start-and-destroy-db f (assoc start-opts :db-graph? true)) - (set! test-db "test-db")) + (start-and-destroy-db f (assoc start-opts :db-graph? true))) (def start-and-destroy-db-map-fixture "To avoid 'Fixtures may not be of mixed types' error