-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move :output distinct logic to ->config
- Loading branch information
1 parent
d974326
commit 0911a97
Showing
4 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
(ns lazytest.config-test | ||
(:require | ||
[lazytest.config :as sut] | ||
[lazytest.core :refer [defdescribe it expect]] | ||
[lazytest.extensions.matcher-combinators :refer [match?]])) | ||
|
||
(defn example-reporter [& _args]) | ||
|
||
(defdescribe ->config-test | ||
(it "works" | ||
(expect | ||
(match? {:output [:keyword] | ||
:reporter fn?} | ||
(sut/->config {:output :keyword})))) | ||
(it "resolves by default to lazytest.reporters" | ||
(expect | ||
(match? {:output ['dots] | ||
:reporter fn?} | ||
(sut/->config {:output 'dots})))) | ||
(it "resolves other reporters correctly" | ||
(expect | ||
(match? {:output ['lazytest.config-test/example-reporter] | ||
:reporter fn?} | ||
(sut/->config {:output 'lazytest.config-test/example-reporter})))) | ||
(it "resolves multiple reporters" | ||
(expect | ||
(match? {:output ['dots 'lazytest.config-test/example-reporter] | ||
:reporter fn?} | ||
(sut/->config {:output ['dots 'lazytest.config-test/example-reporter]})))) | ||
(it "calls distinct on the input" | ||
(expect | ||
(match? {:output ['lazytest.config-test/example-reporter] | ||
:reporter fn?} | ||
(sut/->config {:output ['lazytest.config-test/example-reporter | ||
'lazytest.config-test/example-reporter]}))) | ||
(expect | ||
(match? {:output ['lazytest.config-test/example-reporter 'dots] | ||
:reporter fn?} | ||
(sut/->config {:output ['lazytest.config-test/example-reporter | ||
'dots | ||
'lazytest.config-test/example-reporter]}))))) |