Skip to content

Snapshot tests#28

Draft
stefur wants to merge 6 commits intomthulin:mainfrom
stefur:tests
Draft

Snapshot tests#28
stefur wants to merge 6 commits intomthulin:mainfrom
stefur:tests

Conversation

@stefur
Copy link
Collaborator

@stefur stefur commented Jun 3, 2025

This is an early draft implementing snapshot tests to validate the visual output of oneway and twoway tables. Maybe it's a bit overkill, but I thought it was worth exploring.

There are many options available when creating a table and therefore many different kinds of tables can be produced. The parameterized snapshots in this draft are aimed at testing some of the possible variations (currently only boolean options).

It would have been ideal to use HTML for the snapshot files, but the HTML output of flextable uses randomized class names which breaks the tests. I haven't found a way to control that so for now I went with PNG instead. The main drawback is that captions cannot be included in PNG output.

I still need to add snapshot tests for GT tables as well as tests targeting the internals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant