Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Codeception Snapshot Assertions Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for regression coverage: this package replaces hand-rolled "dump the output to a file and diff it" test helpers with a maintained Codeception module. If any team has a homegrown snapshot harness in a PHP codebase, this is the cheaper path — it is a require-dev Composer dependency with no runtime footprint.
  • Test-suite investment sequencing: snapshot assertions let a team buy broad regression coverage on large textual output (rendered HTML, JSON API payloads, generated config, serializer/formatter output, WordPress template markup) for very little authoring effort. That makes it a good "cheap coverage" line item to fund ahead of more expensive contract or E2E test work.
  • Adoption risk tracking for pre-1.0 tooling: the package is still 0.x. 0.5.0 normalizes spaces to underscores in data set names (PR #22), which means snapshot files previously written using a data set name containing spaces will no longer be matched. For suites with a handful of data sets this is a one-time regeneration pass; for a large suite it is a deliberate "accept new snapshots + eyeball the diff" chore. This is consistent with the package's pre-1.0 contract: pin the version in composer.json and budget small upgrade chores per minor bump.
  • Scope signal: this release is a naming/ergonomics fix, not a feature or API change. It confirms the project is in maintenance-and-polish mode — good for stability, but not a reason to prioritize it on a roadmap or to expect new capabilities soon.

When to Consider This Package

Look at it when all of the following hold:

  • Your test suite is already Codeception-based (this is a Codeception module, not a PHPUnit/Pest extension — that is the single biggest disqualifier).
  • You have output that is large, structured, and painful to assert field-by-field: full HTML documents, JSON responses, generated files.
  • You are comfortable adding a small, single-maintainer, pre-1.0 dev dependency, pinned to an exact version, and reviewing snapshot diffs in code review.

Look elsewhere when:

  • You are on Laravel with PHPUnit/Pest — spatie/phpunit-snapshot-assertions is the better-supported fit, and Laravel's own HTTP testing helpers already cover a lot of response-shape assertions.
  • Snapshot churn would be high (volatile output: timestamps, IDs, ordering) — the maintenance cost will outweigh the coverage and contract tests or targeted assertions are better value.
  • You need organizational support/SLA guarantees — a single-maintainer 0.x package does not provide them; that is acceptable for test tooling, not for anything else.
  • You need it in production code paths — it should never be a runtime dependency.

How to Pitch It (Stakeholders)

To executives: this is a small, free, development-only tool that makes it much cheaper to catch regressions in the large blocks of output our PHP tests produce today. It adds nothing to the shipped product's runtime, carries no licensing cost, and can be removed in an afternoon if it does not pay off. The trade-off to acknowledge is that it is an early-stage (0.x), single-maintainer open-source component, so we pin the version and accept occasional small maintenance chores — the 0.5.0 release is exactly that: an internal naming cleanup that may require regenerating a few stored snapshots. Low cost, low risk, contained to the test suite.

To engineering: the 0.5.0 change replaces spaces with underscores in snapshot data set names, so any snapshots written under a data set name containing spaces will fail to match and need regenerating — worth a quick grep before bumping. Beyond that, adoption is composer require --dev lucatume/codeception-snapshot-assertions pinned to 0.5.0, wire the module into existing Codeception suites, and commit snapshot files so CI diffs are reviewable. Keep it off production dependencies and out of any package's require block.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource