spatie / phpunit-snapshot-assertions

A way to test without writing actual test cases
https://spatie.be/courses/testing-laravel-with-pest/snapshot-testing
MIT License
640 stars 70 forks source link

Feature Request: Support for Tabular-Assertions as a snapshot format #184

Closed dylanbr closed 3 months ago

dylanbr commented 8 months ago

Feature Description

I'd like to propose adding a driver to allow the use of tabular-assertions as the snapshot format. This would bring some benefits, mirroring those offered by tabular-assertions:

Potential Challenges & Solutions

Additional Feature Suggestion


I am interested to hear your thoughts, or any plans regarding this suggestion.

Thank you for considering this feature request.

sebastiandedeyne commented 7 months ago

After releasing tabular assertions I started wondering whether they should be two separate packages, which got me thinking about in the long term for these packages.

I think the ideal destination is supporting inline snapshots like Jest. That way there would only be snapshot testing, and the tabular notation would be just another driver to serialize the date. Users could then choose to write the tables inline or in a snapshot file.

The hard part about inline snapshots is the AST part: writing the output inside the actual test file. Really considering doing this soon though, because it would be the perfect baseline for a lot of other testing possibilities I have in mind…

spatie-bot commented 3 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

dylanbr commented 3 months ago

@sebastiandedeyne I am still very much interested in having this feature, but I'm unable to re-open the issue.

Please would you consider re-opening it so that it does not get buried.