File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 55## Fixed
66
77- Fix beholder watch functionality that would cause a NullPointerException earlier.
8+ - Don't warn if side-effecting ` main ` hook returns nil.
89
910## Changed
1011
Original file line number Diff line number Diff line change @@ -191,13 +191,11 @@ The [hooks chapter](10_hooks.md) has more information about most of these hooks.
191191 ; ; Runs right before kaocha.runner calls kaocha.api/run. This is for plugins
192192 ; ; that optionally do something else besides running tests, like printing
193193 ; ; informational messages and then exiting. For this throw+ a
194- ; ; {:kaocha/early-exit}.
194+ ; ; {:kaocha/early-exit}. Ignores return value.
195195 (main [config]
196- (if (:do-other-thing (:kaocha/cli-options config))
197- (do
198- (... do other thing ...)
199- (throw+ {:kaocha/early-exit 0 }))
200- config))
196+ (when (:do-other-thing (:kaocha/cli-options config))
197+ (... do other thing ...)
198+ (throw+ {:kaocha/early-exit 0 })))
201199
202200 ; ; Gets called after the run is finished and the summary has been printed/reported.
203201 ; ; Gets passed the test result map (test plan with results).
Original file line number Diff line number Diff line change 8989 (reduce (fn [value plugin]
9090 (if-let [step-fn (get plugin step)]
9191 (let [value (apply step-fn value extra-args)]
92- (when (nil? value)
93- (output/warn " Plugin " (:kaocha.plugin/id plugin) " hook " step " returned nil." ))
92+ (when-not (= :kaocha.hooks/main step) ; ; side-effects only
93+ (when (nil? value)
94+ (output/warn " Plugin " (:kaocha.plugin/id plugin) " hook " step " returned nil." )))
9495 value)
9596 value))
9697 value
You can’t perform that action at this time.
0 commit comments