{"id":13732558,"url":"https://github.com/spatie/pest-plugin-snapshots","last_synced_at":"2025-04-10T02:21:35.427Z","repository":{"id":51383070,"uuid":"265036948","full_name":"spatie/pest-plugin-snapshots","owner":"spatie","description":"Add snapshot testing capabilities to Pest","archived":false,"fork":false,"pushed_at":"2024-09-20T14:13:25.000Z","size":56,"stargazers_count":35,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-09-20T15:18:48.387Z","etag":null,"topics":["php","snapshots","testing"],"latest_commit_sha":null,"homepage":"https://pestphp.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"spatie","custom":"https://spatie.be/open-source/support-us"}},"created_at":"2020-05-18T19:11:27.000Z","updated_at":"2024-09-20T14:13:29.000Z","dependencies_parsed_at":"2024-11-10T02:07:32.752Z","dependency_job_id":"3fff92e2-d3ff-4e11-b17c-f5b26484059a","html_url":"https://github.com/spatie/pest-plugin-snapshots","commit_stats":{"total_commits":56,"total_committers":6,"mean_commits":9.333333333333334,"dds":0.6428571428571428,"last_synced_commit":"a24ea0b2e3e9379d042aa8683beb3352644ef2d1"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fpest-plugin-snapshots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fpest-plugin-snapshots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fpest-plugin-snapshots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fpest-plugin-snapshots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/pest-plugin-snapshots/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143118,"owners_count":21054709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","snapshots","testing"],"created_at":"2024-08-03T03:00:26.586Z","updated_at":"2025-04-10T02:21:35.400Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":["https://github.com/sponsors/spatie","https://spatie.be/open-source/support-us"],"categories":["Plugins"],"sub_categories":["Unofficial"],"readme":"# Snapshot Testing for Pest\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/pest-plugin-snapshots.svg?style=flat-square)](https://packagist.org/packages/spatie/pest-plugin-snapshots)\n[![run-tests](https://github.com/spatie/pest-plugin-snapshots/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/pest-plugin-snapshots/actions/workflows/run-tests.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/pest-plugin-snapshots.svg?style=flat-square)](https://packagist.org/packages/spatie/pest-plugin-snapshots)\n\nThis package adds snapshot testing capabilities to **[Pest](https://pestphp.com)**. It wraps\nour [phpunit-snapshot-assertions](https://github.com/spatie/phpunit-snapshot-assertions) package making\nsnapshot assertions available in Pest tests.\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/pest-plugin-snapshots.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/pest-plugin-snapshots)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require spatie/pest-plugin-snapshots --dev\n```\n\n## Usage\n\n```php\nuse function Spatie\\Snapshots\\{assertMatchesSnapshot, assertMatchesJsonSnapshot};\n\nit('can be cast to string', function () {\n    $order = new Order(1);\n\n    assertMatchesSnapshot($order-\u003etoString());\n});\n\nit('can be cast to json', function () {\n    $order = new Order(1);\n\n    assertMatchesJsonSnapshot($order-\u003etoJson());\n});\n```\n\nYou can also use an expectation:\n\n```php\nit('can be cast to string', function () {\n    $order = new Order(1);\n\n    expect($order-\u003etoString())-\u003etoMatchSnapshot();\n});\n```\n\nFor the full list of assertions, please refer to underlying package: [phpunit-snapshot-assertions](https://github.com/spatie/phpunit-snapshot-assertions).\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security\n\nIf you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker.\n\n## Credits\n\n- [Nuno Maduro](https://github.com/nunomaduro)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Fpest-plugin-snapshots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Fpest-plugin-snapshots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Fpest-plugin-snapshots/lists"}