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.
|
||||||
|
|
38
project.clj
38
project.clj
|
@ -6,7 +6,7 @@
|
||||||
: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"
|
||||||
|
@ -16,27 +16,37 @@
|
||||||
: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"
|
||||||
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
|
|
||||||
[org.clojure/tools.nrepl "0.2.10"]]
|
|
||||||
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
|
||||||
:source-paths []
|
|
||||||
:plugins [[lein-cljsbuild "1.1.2"]]
|
|
||||||
:cljsbuild {:builds [{:id "advanced"
|
|
||||||
:source-paths ["src"]
|
|
||||||
:compiler {
|
|
||||||
:output-to "target/datomish.js"
|
|
||||||
:optimizations :advanced
|
:optimizations :advanced
|
||||||
:source-map "target/datomish.js.map"
|
:source-map "target/advanced/datomish.js.map"
|
||||||
:pretty-print true
|
:pretty-print true
|
||||||
:recompile-dependents false
|
:recompile-dependents false
|
||||||
:parallel-build true
|
: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"]
|
||||||
|
[org.clojure/tools.nrepl "0.2.10"]]
|
||||||
|
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
||||||
|
:plugins [[lein-cljsbuild "1.1.2"]
|
||||||
|
[lein-doo "0.1.6"]]
|
||||||
|
}}
|
||||||
|
|
||||||
|
:doo {:build "test"}
|
||||||
|
|
||||||
:clean-targets ^{:protect false} ["target"
|
:clean-targets ^{:protect false} ["target"
|
||||||
"release-js/datomish.bare.js"
|
"release-js/datomish.bare.js"
|
||||||
"release-js/datomish.js"]
|
"release-js/datomish.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