mirror of
https://github.com/penpot/penpot-docs.git
synced 2024-07-06 05:41:47 +00:00
📖 Improve doc about running tests
This commit is contained in:
parent
3e9068b272
commit
fcb21b2c4a
|
@ -94,29 +94,6 @@ using postgresql:
|
|||
pg_dump -h postgres -s > schema.sql
|
||||
```
|
||||
|
||||
|
||||
## Tests ##
|
||||
|
||||
You can run the tests directly with:
|
||||
|
||||
```bash
|
||||
~/penpot/backend$ clojure -M:dev:tests
|
||||
```
|
||||
|
||||
Alternatively, you can run them from a shell. First start a REPL.
|
||||
|
||||
```bash
|
||||
~/penpot/backend$ scripts/repl
|
||||
```
|
||||
|
||||
And then:
|
||||
|
||||
```bash
|
||||
user=> (run-tests)
|
||||
user=> (run-tests 'namespace)
|
||||
user=> (run-tests 'namespace/test)
|
||||
```
|
||||
|
||||
## Linter ##
|
||||
|
||||
There are no watch process for the linter; you will need to execute it
|
||||
|
|
|
@ -337,13 +337,22 @@ Or for some specific output:
|
|||
|
||||
### Running tests in the REPL
|
||||
|
||||
An alternative way of running tests is to do it from inside the REPL you can
|
||||
use in the backend and common apps in the [development environment](/technical-guide/developer/devenv).
|
||||
An alternative way of running tests is to do it from inside the
|
||||
[REPL](/technical-guide/developer/backend/#repl) you can use in the backend and
|
||||
common apps in the development environment.
|
||||
|
||||
We have a helper function `(run-tests)` that refresh the environment (to avoid
|
||||
We have a helper function `(run-tests)` that refreshes the environment (to avoid
|
||||
having [stale tests](https://practical.li/clojure/testing/unit-testing/#command-line-test-runners))
|
||||
and runs all tests or a selection. It is defined in `backend/dev/user.clj` and
|
||||
`common/dev/user.clj`, so it's available in the REPL without importing anything.
|
||||
`common/dev/user.clj`, so it's available without importing anything.
|
||||
|
||||
First start a REPL:
|
||||
|
||||
```bash
|
||||
~/penpot/backend$ scripts/repl
|
||||
```
|
||||
|
||||
And then:
|
||||
|
||||
```clojure
|
||||
;; To run all tests
|
||||
|
|
Loading…
Reference in New Issue
Block a user