Tests
There are three types of tests:
- Unit tests, which are similar to unit or integration tests in other languages and are mostly used to test the API of a package and visual regressions through comparison with reference documents.
Unit tests are standalone files in a
tests
directory inside the project root and have additional features available inside typst using a custom standard library. - Template tests, which are similar to unit tests, but don't get any special features and are only available as persistent tests.
- Doc tests, example code in documentation comments which are compiled but not compared.
Tytanic can currently only collect and operate on unit tests.
In the future, template tests and doc tests will be added, see #34 and #49 respectively.
Any test may use annotations for configuration.
Read the guide, if you want to see some examples on how to write and run various tests.
Sections
- Unit tests explains the structure of unit tests.
- Test library lists the declarations of the custom standard library.
- Annotations lists the syntax for annotations and which are available.