Initial import of LogDarioSeq baseline
Establishes version control for the personal Logseq DB fork before starting the server-client architecture migration and domain features described in docs/agent-guide and the approved implementation plan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
31
deps/db-sync/test/logseq/db_sync/node_config_test.cljs
vendored
Normal file
31
deps/db-sync/test/logseq/db_sync/node_config_test.cljs
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
(ns logseq.db-sync.node-config-test
|
||||
(:require [cljs.test :refer [deftest is testing]]
|
||||
[logseq.db-sync.node.config :as config]))
|
||||
|
||||
(defn- throws? [f]
|
||||
(try
|
||||
(f)
|
||||
false
|
||||
(catch :default _ true)))
|
||||
|
||||
(deftest normalize-config-drops-unknown-keys-test
|
||||
(let [cfg (config/normalize-config {:port 7777
|
||||
:unknown-key "value"
|
||||
:legacy-auth-key "value"})]
|
||||
(is (= 7777 (:port cfg)))
|
||||
(is (nil? (:unknown-key cfg)))
|
||||
(is (nil? (:legacy-auth-key cfg)))))
|
||||
|
||||
(deftest normalize-config-storage-driver-test
|
||||
(testing "sqlite storage driver accepted"
|
||||
(let [cfg (config/normalize-config {:storage-driver "sqlite"})]
|
||||
(is (= "sqlite" (:storage-driver cfg)))))
|
||||
(testing "unsupported storage driver throws"
|
||||
(is (throws? #(config/normalize-config {:storage-driver "other"})))))
|
||||
|
||||
(deftest normalize-config-assets-driver-test
|
||||
(testing "filesystem assets driver accepted"
|
||||
(let [cfg (config/normalize-config {:assets-driver "filesystem"})]
|
||||
(is (= "filesystem" (:assets-driver cfg)))))
|
||||
(testing "unsupported assets driver throws"
|
||||
(is (throws? #(config/normalize-config {:assets-driver "s3"})))))
|
||||
Reference in New Issue
Block a user