Skip to content

Commit

Permalink
Added test coverage settings support via karma-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
alun committed Mar 19, 2018
1 parent cad9157 commit 24ae942
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Install your karma coverage plugin.

Add coverage seetings to your `project.clj`

:doo {:coverage {:packages [:my-app.module]
:doo {:coverage {:packages [my-app.module]
:reporter {:check {:global {:statements 100}}}}}

Packages section is essential, it enables coverage cofiguration and defines which
Expand Down
2 changes: 1 addition & 1 deletion example/build.boot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:dependencies '[[org.clojure/core.async "0.4.474"]
[org.clojure/clojurescript "1.9.946"]
[crisptrutski/boot-cljs-test "0.3.5-SNAPSHOT"]
[doo "0.2.1-SNAPSHOT"]])
[doo "0.1.10-SNAPSHOT"]])

(require
'[crisptrutski.boot-cljs-test :refer [test-cljs]])
Expand Down
4 changes: 2 additions & 2 deletions example/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject lein-doo-example "0.2.1-SNAPSHOT"
(defproject lein-doo-example "0.1.10-SNAPSHOT"
:description "Project to test lein-doo. Do not take it as an example"
:url "https://github.com/bensu/doo"
:license {:name "Eclipse Public License"
Expand All @@ -9,7 +9,7 @@
[org.clojure/core.async "0.4.474"]]

:plugins [[lein-cljsbuild "1.1.7"]
[lein-doo "0.2.1-SNAPSHOT"]]
[lein-doo "0.1.10-SNAPSHOT"]]

:source-paths ["src" "test" "failing-tests"]

Expand Down
2 changes: 1 addition & 1 deletion library/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject doo "0.2.1-SNAPSHOT"
(defproject doo "0.1.10-SNAPSHOT"
:description "doo is a library to run clj.test on different js environments."
:url "https://github.com/bensu/doo"
:license {:name "Eclipse Public License"
Expand Down
3 changes: 2 additions & 1 deletion library/src/doo/coverage.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"Adds preprocessors for sources from a given packages"
[->out-dir package]
(let [package-path (-> (name package)
(clojure.string/replace #"\." "/"))
(clojure.string/replace #"\." "/")
(clojure.string/replace #"-" "_"))
package-files #(->out-dir (str "/" package-path %))
preprocessors ["coverage"]]
[(package-files "/**/!(*test).js") preprocessors]))
Expand Down
2 changes: 1 addition & 1 deletion library/src/doo/karma.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
"client" {"args" ["doo.runner.run_BANG_"]}
"singleRun" true
"plugins" (into ["karma-cljs-test"] launcher-plugins)}
(get-in opts [:karma :config])
(coverage/settings ->out-dir opts)
(get-in opts [:karma :config])
)))

(defn write-var [writer var-name var-value]
Expand Down
4 changes: 2 additions & 2 deletions plugin/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject lein-doo "0.2.1-SNAPSHOT"
(defproject lein-doo "0.1.10-SNAPSHOT"
:description "lein-doo is a plugin to run clj.test on different js environments."
:url "https://github.com/bensu/doo"
:license {:name "Eclipse Public License"
Expand All @@ -13,7 +13,7 @@
:eval-in-leiningen true

:dependencies [[org.clojure/clojure "1.7.0"]
[doo "0.2.1-SNAPSHOT"]]
[doo "0.1.10-SNAPSHOT"]]

:test-paths ["test/clj" "test/cljs"]

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/leiningen/doo.clj
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ in project.clj.\n")
;; FIX: get the version dynamically
project' (-> project
correct-builds
(add-dep ['doo "0.2.1-SNAPSHOT"]))
(add-dep ['doo "0.1.10-SNAPSHOT"]))
{:keys [source-paths compiler]}
(cli->build cli project' opts)
compiler (fix-quoting compiler)
Expand Down

0 comments on commit 24ae942

Please sign in to comment.