-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbuild.boot
More file actions
90 lines (77 loc) · 2.3 KB
/
Copy pathbuild.boot
File metadata and controls
90 lines (77 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(set-env!
:source-paths #{"src"}
:resource-paths #{"resources"}
:dependencies
'[[org.clojure/clojure "1.8.0"]
[crisptrutski/boot-cljs-test "0.3.5-SNAPSHOT" :scope "test"]
[adzerk/boot-test "1.2.0"]])
(require
'[adzerk.boot-test :refer :all]
'[crisptrutski.boot-cljs-test :refer [test-cljs report-errors!] :as cljs-test])
(deftask deps [] identity)
(deftask testing []
(merge-env! :source-paths #{"test"})
identity)
(deftask test-id []
(comp (testing)
(test-cljs
:exit? true
:ids ["boot_cljs_test_example/suite"])))
(deftask test-ids []
(comp (testing)
(test-cljs
:ids ["boot_cljs_test_example/unit"
"boot_cljs_test_example/integration_suite"])))
(deftask test-exclusions []
(comp (testing)
(test-cljs :exclusions #{#"lib"})))
(deftask test-namespaces []
(comp (testing)
(test-cljs
:namespaces [#".*\.lib.*" "wutc"]
:exit? true)))
(deftask test-all []
(comp (testing)
(test-cljs :keep-errors? true)
(test)
(report-errors!)))
(deftask test-watch-karma []
(comp (testing)
(watch)
(speak)
(test-cljs :js-env :chrome)
(test)))
(defn prn-errors [label]
(fn [handler]
(fn [fs]
(prn label "errors" (crisptrutski.boot-error.core/get-errors fs))
(handler fs))))
(defn with-cljs []
(merge-env!
:dependencies
'[[adzerk/boot-cljs "2.1.2" :scope "test"]
[org.clojure/clojurescript "1.9.854" :scope "test"]])
identity)
(defn cljs [& args]
(require 'adzerk.boot-cljs)
(apply @(resolve 'adzerk.boot-cljs/cljs) args))
(deftask test-plumbing []
(comp
(with-cljs)
(testing)
;; warn, no snapshot yet
(cljs-test/fs-restore)
(cljs-test/fs-snapshot)
(cljs-test/prep-cljs-tests :id "beep/boop")
(cljs-test/prep-cljs-tests :id "boop/beep")
(cljs :ids #{"beep/boop"})
(cljs-test/run-cljs-tests :ids ["beep/boop"] :verbosity 2)
(prn-errors "tracked")
(cljs-test/fs-restore)
(prn-errors "cleared")
(cljs :ids #{"boop/beep"})
(cljs-test/run-cljs-tests :ids ["boop/beep"] :verbosity 1)
(cljs-test/fs-restore :keep-errors? true)
(prn-errors "retained")
;; fails, compiled suite rolled back
(cljs-test/run-cljs-tests :ids ["beep/boop"] :verbosity 2)))