Migration
Your tests keep their shape
The cost of changing email testing tool is not the subscription: it is the day spent rewriting assertions that already worked. Here it is the three lines that talk to the provider that change. Your test still waits for a message, and still asserts something about what it holds.
- Three lines per file: the import, the client, the call that waits for the message
- Nothing to export: test messages are regenerated by the next run of the suite
- Both tools side by side while you compare, with nothing to cancel
Before, after
The same test, at one provider then the other
The example starts from Mailosaur, the tool most migrations come from. From Mailtrap, MailSlurp, Mailisk or Mailpit the shape is the same: each tool has a page giving the field-by-field mapping.
// The current tool's client, and the assertion that
// digs the code out of the message body.
const mailosaur = new MailosaurClient(
process.env.MAILOSAUR_API_KEY,
);
const message = await mailosaur.messages.get(
serverId,
{ sentTo: address },
);
expect(message.html.codes[0].value).toBe('265279');// Three lines change. The shape of the test does not.
import { Facteur } from '@facteur-eu/sdk';
const facteur = new Facteur(); // reads FACTEUR_API_KEY
const message = await facteur.messages.waitFor({
sentTo: address,
});
expect(message.otp).toBe('265279');The assertion gets shorter rather than longer: the one-time code arrives already pulled out of the message, in a field, where it used to be fished out of the body with a regular expression.
Two ways
With our library, or by calling the API
The library buys comfort, not capability: everything it does, an HTTP call does too.
The library, if a dependency is fine
One command, and it has no dependencies of its own. The client reads the key from FACTEUR_API_KEY, and its waitFor call holds the connection open until a message matches: no polling loop to write, no sleep to calibrate.
npm i -D @facteur-eu/sdkThe direct call, if it is not
A POST request to /v1/messages/search with a wait field in milliseconds, and the answer arrives when the message does. That is exactly what the library does, with nothing installed.
const res = await fetch(
'https://api.facteur.eu/v1/messages/search',
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.FACTEUR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ sentTo: address, wait: 30000 }),
},
);
const { messages } = await res.json();How to do it
Five steps, none irreversible
The first test moves in ten minutes, and it tells you whether the whole suite will move.
- 1
Create an account and an inbox
An inbox is a mailbox that receives, which your tests query by its id. The free plan is enough to validate the migration, and asks for no card.
- 2
Put the API key in your environment
Under the name FACTEUR_API_KEY, next to your current tool’s. The two live side by side: nothing asks you to remove the old one before you are convinced.
- 3
Move a single test
The one that costs you most when it is flaky. Three lines to change, then you run it: if it passes, your suite will pass. That is the moment of truth and it does not take a day.
- 4
Run both suites in parallel
For a week, long enough to compare pass rates on your own tests rather than on a sales page. It is also what makes going back free.
- 5
Set your ceilings and alerts
A message ceiling per inbox, and a threshold that warns before it is reached: a test that runs away stops at its own limit instead of eating the whole team’s capacity.
By tool
What is specific to the tool you are leaving
Each page carries the field mapping, what has no equivalent here, and prices read on a date written in plain sight.
Mailosaur
The endpoint conversion table, one by one, and which of them are not open yet.
Mailtrap
Moving from a sandbox that intercepts to an inbox that really receives.
MailSlurp
What becomes of an inbox created then deleted on every test, and of per-operation billing.
Mailisk
The cheapest on the market against ours, on the same monthly volume.
Mailpit
Leaving a local interceptor: what you gain, and what you lose by no longer hosting everything.
Known limits
What your current tool does and we do not do yet. Written here rather than discovered halfway through a migration.
- Downloading the raw message as .eml is not open.
- Deliverability analysis (SPF, DKIM, DMARC, spam score) is not open.
- Rendering previews across mail clients and the visual template editor have no equivalent, and will not: it is not the same product.
If your suite depends on one of these, write to us at hello@facteur.eu and we will tell you whether migrating makes sense today, or not.
Common questions
- How many lines change, really?
- Three per test file: the library import, the client construction, and the call that waits for the message. The assertion often gets shorter, because the one-time code arrives already pulled out into a field of the message. What does not change is the shape of the test.
- Does everything have to move at once?
- No, and it is the only advice on this page. Move one test, keep both tools for a week, compare on your own suites. Nothing in the migration is irreversible until you cancel the other subscription, and that decision stays yours.
- What happens to the messages already at the other provider?
- They stay there, and that is what makes the migration light: they are test messages, regenerated by the next run of your suite. There is nothing to export and no DNS cutover to plan.
- What if my tool is not one of the five?
- The steps on this page do not depend on the tool you are leaving: a client, a call that waits, an assertion. Send us the name of the tool and we will tell you what maps across, before you open an account.
Move one test, not a suite
The free plan asks for no card. One file, three lines, and you will know.