spatie/phpunit-snapshot-assertions

JSON encode unescape unicode in snapshot file

Closed this issue · 2 comments

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.

return json_encode($data, JSON_PRETTY_PRINT)."\n";

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

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.