mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 12:51:54 +00:00
Add support for custom snapshot serializers via expect.addSnapshotSerializer(), matching Jest's API. This allows users to define custom formatting for specific value types in snapshots. Changes: - Add serializers registry to Snapshots struct (snapshot.zig) - Implement addSnapshotSerializer() function (expect.zig) - Integrate custom serializers into snapshot formatting pipeline (JSValue.zig) - Initialize serializers array in TestRunner (test_command.zig) - Add comprehensive tests for snapshot serializer functionality The implementation checks registered serializers (in LIFO order) before falling back to default formatting. Serializers can use either the modern 'print' function or legacy 'serialize' function. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>