lucatume/codeception-snapshot-assertions
Snapshot assertions for Codeception: compare arrays, JSON, or rendered HTML against stored snapshot files, creating them automatically on first run and reporting clear diffs when assertions fail.
lucatume/codeception-snapshot-assertions is a Codeception snapshot-assertion helper, not a Laravel-specific package. In a Laravel app, use it in Codeception unit/functional/acceptance suites to lock down stable API payloads, DTO arrays, event payloads, and config structures.
Minimal setup:
composer require --dev lucatume/codeception-snapshot-assertions
$I->sendGET('/api/health');
$I->seeResponseCodeIs(200);
$payload = json_decode($I->grabResponse(), true);
// Use the snapshot assertion exposed by the installed package version.
$this->assertSnapshotEquals($payload);
Where to look first: the package README for assertion method names and snapshot directory configuration, then commit the generated snapshot files so they are reviewed like fixtures.
RefreshDatabase, factories, Carbon::setTestNow(), Queue::fake(), Notification::fake(), and fixed seed data so the snapshot input is deterministic._. If you already have snapshot files whose names contain spaces, the new version may look for an underscore-named file instead. Migration: rename the affected snapshot files, or delete and regenerate them, then review the resulting diff.How can I help you explore Laravel packages today?