diff options
| author | Alex Saveau <saveau.alexandre@gmail.com> | 2023-04-20 01:47:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-20 10:47:31 +0200 |
| commit | c505a0f5dccd120d97926f6ff5bbe0becf783aeb (patch) | |
| tree | c9b57b5e6e7989bf37c13d9c35cd882da3f4e8b3 /tests/README.md | |
| parent | f16ac4d258bd0981506d01456bd5f43079e00fa5 (diff) | |
Add UPDATE_EXPECT envvar to update tests (#748)
Diffstat (limited to 'tests/README.md')
| -rw-r--r-- | tests/README.md | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/README.md b/tests/README.md index 1da8a9c6..627c4caf 100644 --- a/tests/README.md +++ b/tests/README.md @@ -50,18 +50,19 @@ making changes. testit --pdf ``` -## Creating new tests -To keep things small, please optimize reference images before committing them. -When you use the approve button from the Test Helper (see the `tools` folder) -this happens automatically if you have `oxipng` installed. +## Update expected images +If you created a new test or fixed a bug in an existing test, you need to update +the reference image used for comparison. For this, you can use the +`UPDATE_EXPECT` environment varariable or the `--update` flag: ```bash -# One image -oxipng -o max path/to/image.png - -# All images -oxipng -r -o max tests/ref +testit mytest --update ``` +If you use the VS Code test helper extension (see the `tools` folder), you can +alternatively use the checkmark button to update the reference image. In that +case you should also install `oxipng` on your system so that the test helper +can optimize the reference images. + ## Making an alias If you want to have a quicker way to run the tests, consider adding a shortcut to your shell profile so that you can simply write something like: |
