# Testing user sign-up for real: Jest, Puppeteer and email APIs

Humanless is an email API that fits a Jest and Puppeteer signup test: create a disposable inbox in the test, type its address into your signup form with Puppeteer, then `await hl.waitForCode(...)` for a verification code or `hl.waitForLink(...)` for a confirmation link. Both return as soon as the email arrives. Raise Jest's timeout for these tests, because the default is 5 seconds and real email can take longer; `jest.setTimeout(60_000)` or a per-test timeout works. `withIdentity` deletes the inbox even when the test throws, so failed runs don't leave identities behind.

```ts signup.test.ts
import puppeteer from "puppeteer";
import { Humanless, withIdentity } from "humanless"; // npm i -D humanless

const hl = new Humanless({ apiKey: process.env.HUMANLESS_API_KEY! });

test("sign up with a real verification email", async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await withIdentity(hl, { channels: ["email"] }, async ({ identity_id, email }) => {
    await page.goto("http://localhost:3000/signup");
    await page.type("input[name=email]", email!);
    const since = Date.now();
    await page.click("button[type=submit]");
    const { code } = await hl.waitForCode({ identityId: identity_id, since, timeout: 45 });
    await page.type("input[name=code]", code);
    await page.click("button[type=submit]");
    await page.waitForSelector("[data-testid=welcome]");
  });
  await browser.close();
}, 60_000);
```

## Other options

- **Mailpit** for local runs, read with `fetch` from its REST API.
- **MailSlurp or Mailosaur**: hosted inbox APIs with Node clients.
- **The Gmail API** with plus-addressing on a Workspace mailbox.

> **Use policy:** Only for apps you own or are authorized to test. See the [Terms](/terms).

More: [How to test email OTP and verification codes](/guides/playwright-email-otp) · [All answers](/answers/)

Last updated 2026-12-04

Canonical: https://usehumanless.com/answers/testing-user-sign-up-for-real-jest-puppeteer-and-email-apis

---
More: https://usehumanless.com/llms.txt
