1
1
# test-runner
2
2
3
3
` test-runner ` is a small library for discovering and running tests in
4
- plain Clojure projects (i.e, those that use only Clojure's built-in
5
- deps tooling, not Leiningen/boot/etc.)
4
+ projects using native Clojure deps (i.e, those that use only Clojure's
5
+ built-in dependency tooling, not Leiningen/boot/etc.)
6
6
7
7
## Rationale
8
8
@@ -19,28 +19,28 @@ towards the "quick and dirty," besides being nonstandard from project
19
19
to project.
20
20
21
21
This library aims to fill in the gap and provide a standardized,
22
- easy-to-use entry entry point for discovering and running unit and
22
+ easy-to-use entry point for discovering and running unit and
23
23
property-based tests while remaining a lightweight entry in Clojure's
24
24
suite of decomplected project management tools.
25
25
26
26
## Usage
27
27
28
28
Include a dependency on this project in your ` deps.edn ` . You will
29
- probably wish to put it in a ` dev ` or ` test ` alias. For example:
29
+ probably wish to put it in ` test ` alias. You can also include the main
30
+ namespace invocation using Clojure's ` :main-opts ` key. For example:
30
31
31
32
32
33
``` clojure
33
- :aliases {:dev {:extra-paths [" test" ]
34
- :extra-deps {com.cognitect/test-runner {
:git/url " [email protected] :cognitect-labs/test-runner"
35
- :sha " e3e4ce3d7e29349eeff44afd654bc2de6d5f3ae5" }}}}
34
+ :aliases {:test {:extra-paths [" test" ]
35
+ :extra-deps {com.cognitect/test-runner {
:git/url " [email protected] :cognitect-labs/test-runner"
36
+ :sha " 5fb4fc46ad0bf2e0ce45eba5b9117a2e89166479" }}
37
+ :main-opts [" -m" " cognitect.test-runner" ]}}
36
38
```
37
39
38
- Then, invoke Clojure via the command line, passing
39
- ` cognitect.test-runner ` as the main namespace to run using the
40
- ` -m ` option.
40
+ Then, invoke Clojure via the command line, invoking the ` test ` alias:
41
41
42
42
``` bash
43
- clj -Adev -m cognitect.test-runner
43
+ clj -Atest
44
44
```
45
45
46
46
This will scan your project's ` test ` directory for any tests defined
@@ -63,7 +63,7 @@ the `foo.bar` and `foo.baz` namespaces, in the `test` and `src`
63
63
directories:
64
64
65
65
```
66
- clj -Adev -m cognitect.test-runner -d test -d src -n foo.bar -n foo.baz
66
+ clj -Atest -d test -d src -n foo.bar -n foo.baz
67
67
```
68
68
69
69
### Using Inclusions and Exclusions
@@ -80,13 +80,13 @@ For example, you could tag your integration tests like so:
80
80
Then to run only integration tests, you could do:
81
81
82
82
```
83
- clj -Adev -m cognitect.test-runner -i :integration
83
+ clj -Atest -i :integration
84
84
```
85
85
86
86
Or to run all tests * except* for integration tests:
87
87
88
88
```
89
- clj -Adev -m cognitect.test-runner -e :integration
89
+ clj -Atest -e :integration
90
90
```
91
91
92
92
If both inclusions and exclusions are present, exclusions take priority over inclusions.
0 commit comments