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
642 stars 71 forks source link

JSON encode unescape unicode in snapshot file #124

Closed Vovan-VE closed 3 years ago

Vovan-VE commented 3 years ago

Since JSON stored in separate .json file, a default escaping for slashes and unicode are unnecessary. Moreover, escaped unicode codepoints reduce .json snapshot readability (git diff).

Please add JSON_UNESCAPED_SLASHES and JSON_UNESCAPED_UNICODE flags to json_encode() calls.

https://github.com/spatie/phpunit-snapshot-assertions/blob/b6c9aac4cee1e5176c2a90b23971c665e66a290f/src/Drivers/JsonDriver.php#L21

Vovan-VE commented 3 years ago

This would be BC break change, so it would be better to give an options to optionally disable unicode escaping.

spatie-bot commented 3 years 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.