Tests

There are three types of tests:

  • Regression 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. Regression 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 regression 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.

typst-test can currently only collect and operate on regression 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