Is there a way to "unit test" a quarto project? #12313
-
DescriptionPerhaps my question isn't very clear, but I'd like to be able to check that my quarto project isn't broken in the same way that we do unit tests in any software project. For example, I'd like to test that the Are there any tools built into the CLI? Or extensions that cover this specific topic? I couldn't find any resources after browsing Google. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Quarto includes a validator, so it won't render unless it considers the YAML valid (for its own notion of valid, of course. It won't be able to catch, eg, typos in author names). If you want to run these yourself, a good way to do it is to add a pre-render script to your quarto project: https://quarto.org/docs/projects/scripts.html#pre-and-post-render. You can also leverage |
Beta Was this translation helpful? Give feedback.
Quarto includes a validator, so it won't render unless it considers the YAML valid (for its own notion of valid, of course. It won't be able to catch, eg, typos in author names).
If you want to run these yourself, a good way to do it is to add a pre-render script to your quarto project: https://quarto.org/docs/projects/scripts.html#pre-and-post-render. You can also leverage
quarto run
and a Makefile if you don't want the tests to be run at every render. Finally, you might want to runquarto inspect
in your projec…