All Projects → spatie → pest-plugin-snapshots

spatie / pest-plugin-snapshots

Licence: MIT license
Add snapshot testing capabilities to Pest

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to pest-plugin-snapshots

nextjs-ts-antd-redux-storybook-starter
🏃🏼 Next.js + TypeScript + Ant Design + Redux Toolkit + Redux Saga + Styled Components + Jest + Storybook 企业级项目脚手架模板
Stars: ✭ 78 (+178.57%)
Mutual labels:  snapshots
cosmos-snapshots
Automatic snapshots of the blockchain state
Stars: ✭ 71 (+153.57%)
Mutual labels:  snapshots
Foundatio.Repositories
Generic repositories
Stars: ✭ 74 (+164.29%)
Mutual labels:  snapshots
RDS-sanitized-snapshots
Take periodic snapshots of RDS databases, sanitize them, and share with other accounts. Useful for QA/dev databases.
Stars: ✭ 41 (+46.43%)
Mutual labels:  snapshots
Starwars.ios
This component implements transition animation to crumble view-controller into tiny pieces.
Stars: ✭ 3,685 (+13060.71%)
Mutual labels:  snapshots
mocha-snapshots
Snapshot/regression testing for using with Mocha, specially for React+Enzyme users.
Stars: ✭ 53 (+89.29%)
Mutual labels:  snapshots
coldsnap
A command line interface for Amazon EBS snapshots
Stars: ✭ 92 (+228.57%)
Mutual labels:  snapshots
rusnapshot
Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLite.
Stars: ✭ 27 (-3.57%)
Mutual labels:  snapshots
pdo-snapshot-store
PDO Snapshot Store
Stars: ✭ 24 (-14.29%)
Mutual labels:  snapshots
zfsbootmenu
ZFS Bootloader for root-on-ZFS systems with support for snapshots and native full disk encryption
Stars: ✭ 377 (+1246.43%)
Mutual labels:  snapshots
ee.Screen
Takes screenshots of web pages for the list of URLs. Various resolutions, multiple formats (JPG, PDF, PNG and TXT)
Stars: ✭ 19 (-32.14%)
Mutual labels:  snapshots
snapshot
Adds value / object / DOM element snapshot testing support to Cypress test runner
Stars: ✭ 114 (+307.14%)
Mutual labels:  snapshots

Snapshot Testing for Pest

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package adds snapshot testing capabilities to Pest. It wraps our phpunit-snapshot-assertions package making snapshot assertions available in Pest tests.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We 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. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require spatie/pest-plugin-snapshots --dev

Usage

use function Spatie\Snapshots\{assertMatchesSnapshot, assertMatchesJsonSnapshot};

it('can be cast to string', function () {
    $order = new Order(1);

    assertMatchesSnapshot($order->toString());
});

it('can be cast to json', function () {
    $order = new Order(1);

    assertMatchesJsonSnapshot($order->toJson());
});

You can also use an expectation:

it('can be cast to string', function () {
    $order = new Order(1);

    expect($order->toString())->toMatchSnapshot();
});

For the full list of assertions, please refer to underlying package: phpunit-snapshot-assertions.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].