File tree Expand file tree Collapse file tree 6 files changed +8
-13
lines changed Expand file tree Collapse file tree 6 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ Here's an example test configuration with a single test suite:
20
20
:kaocha/source-paths [" src" ]
21
21
:kaocha/test-paths [" test/unit" ]}]
22
22
:kaocha/fail-fast? false
23
- :kaocha/mute-zero-assertion? true
24
23
:kaocha/color? true
25
24
:kaocha/reporter [kaocha.report/dots]
26
25
:kaocha/plugins [:kaocha.plugin/randomize
Original file line number Diff line number Diff line change @@ -36,9 +36,7 @@ Test ran without assertions. Did you forget an (is ...)?
36
36
37
37
There are two ways to disable this detection:
38
38
39
- * Enable ` :mute-zero-assertion? ` at ` tests.edn ` .
40
- * Use ` --mute-zero-assertion ` in command line argument.
41
-
39
+ * Add ` :kaocha/warnings {:zero-assertions :silent} ` into ` tests.edn ` .
42
40
43
41
## Detecting single argument ` = `
44
42
Original file line number Diff line number Diff line change 92
92
(let [config (plugin/run-hook :kaocha.hooks/config config)
93
93
color? (:kaocha/color? config)
94
94
fail-fast? (:kaocha/fail-fast? config)
95
- mute-zero-assertion? (:kaocha/mute-zero-assertion? config)
95
+ warnings (:kaocha/warnings config)
96
96
history (atom [])]
97
97
(binding [*active?* true
98
98
testable/*fail-fast?* fail-fast?
103
103
(let [config (resolve-reporter config)]
104
104
(let [test-plan (test-plan config)]
105
105
106
- (when mute- zero-assertion?
106
+ (when ( = ( : zero-assertions warnings) :silent )
107
107
(hierarchy/underive! :kaocha.type.var/zero-assertions :kaocha/known-key )
108
108
(hierarchy/underive! :kaocha.type.var/zero-assertions :kaocha/fail-type ))
109
109
Original file line number Diff line number Diff line change 78
78
reporter
79
79
color?
80
80
fail-fast?
81
- mute-zero-assertion?
81
+ warnings
82
82
diff-style
83
83
randomize?
84
84
capture-output?
89
89
tests (assoc :kaocha/tests (vary-meta tests assoc :replace true ))
90
90
plugins (assoc :kaocha/plugins plugins)
91
91
reporter (assoc :kaocha/reporter (vary-meta reporter assoc :replace true ))
92
+ warnings (assoc :kaocha/warnings warnings)
92
93
bindings (assoc :kaocha/bindings bindings)
93
94
(some? color?) (assoc :kaocha/color? color?)
94
95
(some? fail-fast?) (assoc :kaocha/fail-fast? fail-fast?)
95
- (some? mute-zero-assertion?) (assoc :kaocha/mute-zero-assertion? mute-zero-assertion?)
96
96
(some? diff-style) (assoc :kaocha/diff-style diff-style)
97
97
(some? watch?) (assoc :kaocha/watch? watch?)
98
98
(some? randomize?) (assoc :kaocha.plugin.randomize/randomize? randomize?)
99
99
(some? capture-output?) (assoc :kaocha.plugin.capture-output/capture-output? capture-output?)
100
- :-> (merge (dissoc config :tests :plugins :reporter :color? :fail-fast? :mute-zero-assertion ? :watch? :randomize? )))))
100
+ :-> (merge (dissoc config :tests :plugins :reporter :warnings : color? :fail-fast? :watch? :randomize? )))))
101
101
102
102
(defmethod aero /reader 'kaocha [_opts _tag value]
103
103
(output/warn (format " The #kaocha reader literal is deprecated, please change it to %s." current-reader))
200
200
(defn apply-cli-opts [config options]
201
201
(cond-> config
202
202
(some? (:fail-fast options)) (assoc :kaocha/fail-fast? (:fail-fast options))
203
- (some? (:mute-zero-assertion options)) (assoc :kaocha/mute-zero-assertion? (:mute-zero-assertion options))
204
203
(:reporter options) (assoc :kaocha/reporter (:reporter options))
205
204
(:watch options) (assoc :kaocha/watch? (:watch options))
206
205
(some? (:color options)) (assoc :kaocha/color? (:color options))
Original file line number Diff line number Diff line change 32
32
[nil " --print-test-plan" " Load tests, build up a test plan, then print out the test plan and exit." ]
33
33
[nil " --print-result" " Print the test result map as returned by the Kaocha API." ]
34
34
[nil " --[no-]fail-fast" " Stop testing after the first failure." ]
35
- [nil " --[no-]mute-zero-assertion" " Stop raising failure when there is no assertion in test." ]
36
35
[nil " --[no-]color" " Enable/disable ANSI color codes in output. Defaults to true." ]
37
36
[nil " --[no-]watch" " Watch filesystem for changes and re-run tests." ]
38
37
[nil " --reporter SYMBOL" " Change the test reporter, can be specified multiple times."
Original file line number Diff line number Diff line change 22
22
23
23
(spec/def :kaocha/fail-fast? boolean? )
24
24
25
- (spec/def :kaocha/mute- zero-assertion? boolean? )
25
+ (spec/def :kaocha/warnings ( spec/map-of #{ : zero-assertions } #{ :silent :error }) )
26
26
27
27
(spec/def :kaocha/watch? boolean? )
28
28
36
36
(spec/keys :opt [:kaocha/reporter
37
37
:kaocha/color?
38
38
:kaocha/fail-fast?
39
- :kaocha/mute-zero-assertion?
39
+ :kaocha/warnings
40
40
:kaocha/watch?
41
41
:kaocha/plugins ]))
42
42
You can’t perform that action at this time.
0 commit comments