Check that no email arrives
expect_no_emailWatches the address for up to 30 seconds and passes if no matching email arrives, for checks such as "an unsubscribed user gets nothing" or "a second reset request is rate-limited". Answers as soon as one does arrive, saying when and from whom (passed: false), never what it says. Pass since as the time the action happened. For longer, pass until (up to 60 minutes after since) and call again with the same since and until while done is false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test | No | With run_id: the test or step this call belongs to, shown beside what it saw in the report. | |
| type | No | Only emails with a code, or with a link. | |
| since | No | Only email received at or after this time, such as when the test submitted the form. | |
| until | No | With since: the end of a longer window, up to 60 minutes after since. Each call still watches up to 30 seconds; done says when the window is over. | |
| run_id | No | A run from start_run: what this call sees is added to its report. | |
| address | Yes | A test address in this project. A variant works too (capitals, or a +tag such as name+o'brien@…): it acts on the plain address, and a wait on a +tag variant only finds mail sent to it. | |
| service | No | Only email from this sender, by service name or domain. | |
| subtype | No | With type, comma-separated: otp or coupon for codes; verify, magic_signin, invite, reset, other, unsubscribe or list_unsubscribe for links; or any (for links, the sign-in kinds and other). | |
| category | No | Only sign-in emails (auth), receipts and notices (transactional), or offers and newsletters (marketing). For "an unsubscribed user gets no marketing", use marketing: receipts should still arrive. | |
| timeout_seconds | No | How long to watch. 0 checks once. |