Skip to content

Conversation

@vezwork
Copy link
Collaborator

@vezwork vezwork commented Aug 7, 2025

Description

  • Adds a readOrCreateSnapshot helper function that makes snapshot tests convenient to create:
    • If you don't already have a snapshot, it creates one with the passed contents and returns the contents
    • If you do already have a snapshot, it reads it and returns the contents
  • Adds two roundtripping snapshot tests based on Quarto documents from https://github.com/quarto-dev/quarto-markdown-test-corpus
    • valid-basics.qmd
    • invalid.qmd

For fun, here's a screenshot of the diff between valid-basics.qmd before and after roundtrip

I got this in VSCode by right clicking on valid-basics.qmd, then clicking "select for compare", then right clicking generated_snapshots/roundtripped-valid-basics.qmd, then clicking "compare with selected".
image

@vezwork vezwork requested review from cscheid and juliasilge August 7, 2025 19:59
@vezwork vezwork marked this pull request as ready for review August 7, 2025 19:59
Copy link
Collaborator

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great for me locally as well!

@vezwork vezwork merged commit c2f847e into main Aug 12, 2025
2 checks passed
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.

3 participants