Skip to content
You're viewing documentation for v0.4.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Test email behavior

Assert sends, retries, fallbacks, and plugin behavior.

Use the memory provider when you want to replace the provider. Use the capture plugin when you want to observe the normal send pipeline.

Memory provider

The memory provider stores successful sends and never calls an external API.

Capture plugin

The capture plugin records lifecycle events. It can be used with the memory provider or with a custom test adapter.

Assert defaults

Defaults run before message validation, so tests can assert the final message that reached the provider.

Assert fallback

Use a small failing adapter plus a memory adapter.

Test checklist

  • Use memoryProvider() for app tests that should not call real providers.
  • Use capturePlugin() when you need lifecycle events.
  • Assert provider field support with adapter unit tests.
  • Add one test for fallback if the route matters.
  • Add one test for plugin ordering when multiple plugins mutate the same message.

Last updated on