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
- In Settings > Seed, press Export sendmock.seed.toml.
- 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. - Start SendMock with it:
sendmock --seed sendmock.seed.toml(or mount it at/config/sendmock.seed.tomlin Docker). - Before each test run, reset to it: Settings > General > Reset to seed, or
sendmock reset --yes, orPOST /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/nullWhat 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
- Open Settings > Seed.
- Press Export sendmock.seed.toml. The file downloads.