Skip to content
Permalink
Browse files

added cljs test generation

  • Loading branch information...
yogthos committed Jan 30, 2016
1 parent 61f25b8 commit 6e5320d648bd570ab197073c762615cf3a532d4e
@@ -3,6 +3,8 @@

(def cljs-assets
[["src-cljs/{{sanitized}}/core.cljs" "cljs/src/cljs/core.cljs"]
["test-cljs/{{sanitized}}/doo_runner.cljs" "cljs/test/cljs/doo_runner.cljs"]
["test-cljs/{{sanitized}}/core_test.cljs" "cljs/test/cljs/core_test.cljs"]
["env/dev/cljs/{{sanitized}}/dev.cljs" "cljs/env/dev/cljs/app.cljs"]
["env/prod/cljs/{{sanitized}}/prod.cljs" "cljs/env/prod/cljs/app.cljs"]
["resources/templates/home.html" "cljs/templates/home.html"]
@@ -25,6 +27,7 @@

(def cljs-dev-plugins
[['lein-figwheel "0.5.0-6"]
['lein-doo "0.1.6"]
['org.clojure/clojurescript "1.7.228"]])

(def clean-targets [:target-path
@@ -33,6 +36,7 @@

(def cljs-dev-dependencies
[['lein-figwheel "0.5.0-6"]
['lein-doo "0.1.6"]
['com.cemerick/piggieback "0.2.2-SNAPSHOT"]])

(def cljs-build
@@ -59,7 +63,15 @@
:compiler {:main (str project-ns ".app")
:asset-path "/js/out"
:optimizations :none
:source-map true}}}}})
:source-map true}}
:test {:source-paths ["src-cljs" "test-cljs"]
:compiler {:output-to "target/test.js"
:main (str project-ns ".doo-runner")
:optimizations :whitespace
:pretty-print true}}}}})

(def cljs-test
{:build "test"})

(defn figwheel [{:keys [project-ns]}]
{:http-server-root "public"
@@ -82,6 +94,7 @@
(assoc
:cljs true
:cljs-build (indent root-indent cljs-build)
:cljs-test cljs-test
:figwheel (indent dev-indent (figwheel options))
:cljs-dev (unwrap-map (indent dev-indent (cljs-dev options)))
:cljs-uberjar (unwrap-map (indent uberjar-indent cljs-uberjar))))]
@@ -0,0 +1,8 @@
(ns <<project-ns>>.core-test
(:require [cljs.test :refer-macros [is are deftest testing use-fixtures]]
[reagent.core :as reagent :refer [atom]]
[<<project-ns>>.core :as rc]))

(deftest test-home
(is (= true true)))

@@ -0,0 +1,6 @@
(ns <<project-ns>>.doo-runner
(:require [doo.runner :refer-macros [doo-tests]]
[<<project-ns>>.core-test]))

(doo-tests '<<project-ns>>.core-test)

@@ -61,7 +61,7 @@
<% if dev-plugins %>:plugins <<dev-plugins>><% endif %><% if cljs-dev %>
<<cljs-dev>><% endif %>
<% if figwheel %>:figwheel
<<figwheel>><% endif %>
<<figwheel>><% endif %><% if cljs-test %>:doo <<cljs-test>><% endif %>
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user}

0 comments on commit 6e5320d

Please sign in to comment.
You can’t perform that action at this time.