diff --git a/README.md b/README.md index 3fc188898fe..88e178a431b 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,20 @@ Open . yarn release ``` +### 5. Run tests + +Run ClojureScript tests +```bash +yarn +yarn cljs:test +node static/tests.js +``` + +Run Clojure tests. (Note: `.cljc` files may be tested both by ClojureScript, and Clojure.) +```bash +clj -Mtest-clj +``` + ## Alternative: Docker based development environment ### 1. Fetch sources diff --git a/deps.edn b/deps.edn index 6426d2916c4..5a76870744d 100755 --- a/deps.edn +++ b/deps.edn @@ -1,6 +1,7 @@ {:paths ["src/main"] :deps {org.clojure/clojure {:mvn/version "1.10.0"} + cheshire/cheshire {:mvn/version "5.10.0"} rum/rum {:mvn/version "0.12.3"} ;; rum {:local/root "/home/tienson/codes/source/clj/rum"} ;; persistent-sorted-set {:mvn/version "0.1.2"} @@ -44,11 +45,14 @@ org.clojure/clojurescript {:mvn/version "1.10.764"} org.clojure/test.check {:mvn/version "RELEASE"}} :main-opts ["-m" "shadow.cljs.devtools.cli"]} + :test-clj {:extra-paths ["src/test/"] :extra-deps - {cheshire/cheshire {:mvn/version "5.10.0"} + { com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner", :sha "76568540e7f40268ad2b646110f237a60295fa3c"}}, :main-opts ["-m" "cognitect.test-runner" "-d" "src/test"]}}} + + diff --git a/src/main/frontend/external/roam.cljc b/src/main/frontend/external/roam.cljc index 649165b7b22..1c2178d522e 100644 --- a/src/main/frontend/external/roam.cljc +++ b/src/main/frontend/external/roam.cljc @@ -128,7 +128,7 @@ (defrecord Roam [] protocol/External (toMarkdownFiles [this content _config] - (->files content))) + (-> content json->edn ->files))) (comment (defonce test-roam-json (frontend.db/get-file "same.json")) diff --git a/src/test/frontend/external/roam_test.cljc b/src/test/frontend/external/roam_test.cljc index 3b3d96a1824..a4f8262a9a2 100644 --- a/src/test/frontend/external/roam_test.cljc +++ b/src/test/frontend/external/roam_test.cljc @@ -26,12 +26,11 @@ (deftest json->edn-test (is (= [1 {:foo 42, :bar "baz"} 3] (roam/json->edn "[1, {\"foo\": 42, \"bar\": \"baz\"}, 3]")))) -(comment - (deftest roam-import-test - (let [got (to-markdown-files :roam minimal-json {}) - md (first got)] - (is (= 1 (count got))) - (is (= "Export JSON" (:title md))) - (is (:created-at md)) - (is (:last-modified-at md)) - (is (= "---\ntitle: Export JSON\n---\n\n## Hello, world!\n" (:text md)))))) \ No newline at end of file +(deftest roam-import-test + (let [got (to-markdown-files :roam minimal-json {}) + md (first got)] + (is (= 1 (count got))) + (is (= "Export JSON" (:title md))) + (is (:created-at md)) + (is (:last-modified-at md)) + (is (= "---\ntitle: Export JSON\n---\n\n## Hello, world!\n" (:text md))))) \ No newline at end of file