Add lein-doo to run ClojureScript tests.
This commit is contained in:
parent
f2365646d2
commit
08f7084d92
4 changed files with 55 additions and 27 deletions
|
@ -130,6 +130,10 @@ Now you can use `:Eval`, `cqc`, and friends to evaluate code. Fireplace should c
|
||||||
:Connect nrepl://localhost:62385
|
:Connect nrepl://localhost:62385
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## To run the ClojureScript tests
|
||||||
|
|
||||||
|
Run `lein doo node test once`, or `lein doo node` to re-run on file changes.
|
||||||
|
|
||||||
### Preparing an NPM release
|
### Preparing an NPM release
|
||||||
|
|
||||||
The intention is that the `release-js/` directory is roughly the shape of an npm-ready JavaScript package.
|
The intention is that the `release-js/` directory is roughly the shape of an npm-ready JavaScript package.
|
||||||
|
|
64
project.clj
64
project.clj
|
@ -2,40 +2,50 @@
|
||||||
:description "A persistent, embedded knowledge base inspired by Datomic and DataScript."
|
:description "A persistent, embedded knowledge base inspired by Datomic and DataScript."
|
||||||
:url "https://github.com/mozilla/datomish"
|
:url "https://github.com/mozilla/datomish"
|
||||||
:license {:name "Mozilla Public License Version 2.0"
|
:license {:name "Mozilla Public License Version 2.0"
|
||||||
:url "https://github.com/mozilla/datomish/blob/master/LICENSE"}
|
:url "https://github.com/mozilla/datomish/blob/master/LICENSE"}
|
||||||
:dependencies [[org.clojure/clojurescript "1.9.89"]
|
:dependencies [[org.clojure/clojurescript "1.9.89"]
|
||||||
[org.clojure/clojure "1.8.0"]]
|
[org.clojure/clojure "1.8.0"]]
|
||||||
|
|
||||||
:cljsbuild {:builds [{:id "release"
|
:cljsbuild {:builds {:release {
|
||||||
:source-paths ["src"]
|
:source-paths ["src"]
|
||||||
:assert false
|
:assert false
|
||||||
:compiler {:output-to "release-js/datomish.bare.js"
|
:compiler {:output-to "release-js/datomish.bare.js"
|
||||||
:optimizations :advanced
|
:optimizations :advanced
|
||||||
:pretty-print false
|
:pretty-print false
|
||||||
:elide-asserts true
|
:elide-asserts true
|
||||||
:output-wrapper false
|
:output-wrapper false
|
||||||
:parallel-build true}
|
:parallel-build true}
|
||||||
:notify-command ["release-js/wrap_bare.sh"]}
|
:notify-command ["release-js/wrap_bare.sh"]}
|
||||||
]}
|
:advanced {:source-paths ["src"]
|
||||||
|
:compiler {:output-to "target/advanced/datomish.js"
|
||||||
|
:optimizations :advanced
|
||||||
|
:source-map "target/advanced/datomish.js.map"
|
||||||
|
:pretty-print true
|
||||||
|
:recompile-dependents false
|
||||||
|
:parallel-build true
|
||||||
|
}}
|
||||||
|
:test {
|
||||||
|
:source-paths ["src" "test"]
|
||||||
|
:compiler {:output-to "target/test/datomish.js"
|
||||||
|
:output-dir "target/test"
|
||||||
|
:main datomish.test
|
||||||
|
:optimizations :none
|
||||||
|
:source-map true
|
||||||
|
:recompile-dependents false
|
||||||
|
:parallel-build true
|
||||||
|
:target :nodejs
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
|
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
|
||||||
[org.clojure/tools.nrepl "0.2.10"]]
|
[org.clojure/tools.nrepl "0.2.10"]]
|
||||||
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
||||||
:source-paths []
|
:plugins [[lein-cljsbuild "1.1.2"]
|
||||||
:plugins [[lein-cljsbuild "1.1.2"]]
|
[lein-doo "0.1.6"]]
|
||||||
:cljsbuild {:builds [{:id "advanced"
|
}}
|
||||||
:source-paths ["src"]
|
|
||||||
:compiler {
|
:doo {:build "test"}
|
||||||
:output-to "target/datomish.js"
|
|
||||||
:optimizations :advanced
|
|
||||||
:source-map "target/datomish.js.map"
|
|
||||||
:pretty-print true
|
|
||||||
:recompile-dependents false
|
|
||||||
:parallel-build true
|
|
||||||
}}
|
|
||||||
]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:clean-targets ^{:protect false} ["target"
|
:clean-targets ^{:protect false} ["target"
|
||||||
"release-js/datomish.bare.js"
|
"release-js/datomish.bare.js"
|
||||||
|
|
7
test/datomish/test.cljs
Normal file
7
test/datomish/test.cljs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
(ns datomish.test
|
||||||
|
(:require
|
||||||
|
[doo.runner :refer-macros [doo-tests]]
|
||||||
|
[cljs.test :as t :refer-macros [is are deftest testing]]
|
||||||
|
datomish.test.core))
|
||||||
|
|
||||||
|
(doo-tests 'datomish.test.core)
|
7
test/datomish/test/core.cljs
Normal file
7
test/datomish/test/core.cljs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
(ns datomish.test.core
|
||||||
|
(:require
|
||||||
|
[cljs.test :as t :refer-macros [is are deftest testing]]
|
||||||
|
[datomish.core :as d]))
|
||||||
|
|
||||||
|
(deftest test-core
|
||||||
|
(is (= 1 1)))
|
Loading…
Reference in a new issue