Preview: SendMock has no stable release yet. These docs follow develop.
SendMock
Recipes

Share your setup

Export your endpoints, rules, templates, numbers and settings as a seed file, commit it, and give your team and CI the same SendMock.

Try it in the demo.

The situation: you set up endpoints, rules, numbers and a Verify service. A teammate, and your CI, should start with exactly the same, and every test run should start clean.

Steps

  1. In Settings > Seed, press Export sendmock.seed.toml.
  2. Put the file in your app's repository, next to your code, and commit it. Secrets are written as ${ENV_VAR} references, never in plain text; set those variables on each machine.
  3. Start SendMock with it: sendmock --seed sendmock.seed.toml (or mount it at /config/sendmock.seed.toml in Docker).
  4. Before each test run, reset to it: Settings > General > Reset to seed, or sendmock reset --yes, or POST /api/v1/reset. Traffic is deleted and the configuration is the file's again.

In your code

Run this before each test: traffic is deleted and the configuration is the seed file's again.

The examples call SendMock's REST API with each language's usual HTTP client and test framework. JavaScript, Go, Java, Rust, Ruby and C# use the small call helper shown under Test helper on their page in Connect your app.

sendmock reset --yes

stats=$(sendmock stats --json)

jq -e '.email_count == 0' <<<"$stats" >/dev/null

What you should see

On a teammate's machine, the same endpoints, rules, templates, variables (secrets from their environment), numbers, Messaging Services, Verify services, payment setup and settings.

Try it in the demo

  1. Open Settings > Seed.
  2. Press Export sendmock.seed.toml. The file downloads.

Next

On this page