dánwòdánwò

Providers

Emulator helpers

Reading what the app did at a provider, or acting as a provider's user.

Read what the app did at a provider, or act as a provider's user, from a test or an invariant.

gmailMail

function

gmailMail(emulator: Pick<Emulator, "store" | "outbox">): MailSource

Mail delivered to a Gmail mailbox of the Google emulator.

outlookMail

function

outlookMail(emulator: Pick<Emulator, "store" | "outbox">): MailSource

Mail delivered to an Outlook mailbox of the Microsoft emulator.

resendMail

function

resendMail(emulator: Pick<Emulator, "store">): MailSource

Mail the Resend emulator accepted from the app.

twilioSms

function

twilioSms(emulator: Pick<Emulator, "store">): MailSource

Texts the Twilio emulator sent to phones, by the app or by Verify, read like mail: the address is the phone number, so read_mail, mail.code(phone) and the recording of a typed code work for SMS just as for email, and a replay reads the new code from the new phone's texts.

auth0OtpAt

function

otpAt(secret: string, time: Date): string

The one-time code an authenticator app shows for secret at time.

auth0Tenant

function

auth0Tenant(emulator: Pick<Emulator, "store">, domain?: string): Auth0Tenant

What domain's tenant holds and has done; the first tenant when no domain is given.

flutterwaveBank

function

flutterwaveBank(emulator: Pick<Emulator, "store" | "outbox">): FlutterwaveBank

Money arriving at a Flutterwave emulator's virtual accounts.

flutterwaveLedger

function

flutterwaveLedger(emulator: Pick<Emulator, "store" | "outbox">): FlutterwaveLedger

The books of a Flutterwave emulator.

githubAppKey

function

githubAppKey(emulator: Pick<Emulator, "store">, slug: string): string

The private key (PEM) of a seeded GitHub App, for signing its JWTs.

githubRepo

function

githubRepo(emulator: Pick<Emulator, "store">, fullName: string): GithubRepoView

Reads a repository's issues, comments, check runs and files from a GitHub emulator.

githubSignIns

function

githubSignIns(emulator: Pick<Emulator, "store">): SignIns

Who signed in to which OAuth App or GitHub App, for tests.

gmailMailbox

function

gmailMailbox( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): GmailMailbox

Reads and changes email's Gmail mailbox from a test.

googleCalendar

function

googleCalendar( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): GoogleCalendar

A user's Google Calendar in the emulator: read events, and change them as if from elsewhere.

googleDrive

function

googleDrive( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): GoogleDrive

A user's Google Drive in the emulator: read files, and change them as if from elsewhere.

googleSignIns

function

googleSignIns(emulator: Pick<Emulator, "store">): SignIns

Who signed in to which client, for tests.

graphSubscriptions

function

graphSubscriptions(emulator: Pick<Emulator, "store">): GraphSubscriptionEntry[]

The subscriptions apps have made in a Microsoft emulator, live or expired.

installGithubApp

function

installGithubApp( emulator: Pick<Emulator, "store" | "outbox">, installation: GithubSeedInstallation, ): number

Installs a seeded app on an account, as a person would on github.com, and sends the app its installation created webhook. Returns the installation id.

listeningPort

function

listeningPort(server: Server): number

The TCP port a listening server is bound to. Throws when the server is not listening yet, or is bound to a pipe or socket path rather than a port.

microsoftSignIns

function

microsoftSignIns(emulator: Pick<Emulator, "store">): SignIns

Who signed in to which app, for tests.

llmCalls

function

llmCalls(emulator: Emulator): LlmCalls

The calls the app made to OpenAI, Anthropic and the AI Gateway, oldest first.

llmScripts

function

llmScripts(emulator: Emulator): LlmScripts

Scripts a test adds to the model API emulator while it runs.

oneDrive

function

oneDrive(emulator: Pick<Emulator, "store" | "outbox">, email: string): OneDrive

One user's OneDrive in a Microsoft emulator.

outlookCalendar

function

outlookCalendar( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): OutlookCalendar

One user's Outlook calendar in a Microsoft emulator.

outlookMailbox

function

outlookMailbox( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): OutlookMailbox

One user's Outlook mailbox in a Microsoft emulator.

paystackBank

function

paystackBank(emulator: Pick<Emulator, "store" | "outbox">): PaystackBank

A test's stand-in for a customer's bank, for paying into dedicated accounts.

paystackLedger

function

paystackLedger(emulator: Pick<Emulator, "store">): PaystackLedger

Reads back what a Paystack emulator holds: transactions, transfers, refunds, customers, subscriptions.

revokeGoogleAccess

function

revokeGoogleAccess( emulator: Pick<Emulator, "store">, email: string, clientId?: string, ): void

Removes the app's access as the user would from their Google Account: every token email holds for clientId (or for every client) is revoked, so API calls get 401 and refreshes get invalid_grant.

revokeMicrosoftSessions

function

revokeMicrosoftSessions(emulator: Pick<Emulator, "store">, email: string): number

Signs a user out of every app, as when they change their password or an admin revokes their sessions: refresh tokens fail with invalid_grant and Graph refuses their access tokens.

resendInbox

function

resendInbox(emulator: Pick<Emulator, "store">): ResendInbox

What the Resend emulator accepted, read the way a test reads a mailbox.

s3Objects

function

s3Objects(emulator: Pick<Emulator, "store">): S3Objects

What the S3 emulator holds, read the way a test inspects a bucket.

slackWorkspace

function

slackWorkspace(emulator: Pick<Emulator, "store" | "outbox">): SlackWorkspace

The workspace of a Slack emulator, for tests.

twilioInbox

function

twilioInbox(emulator: Pick<Emulator, "store">): TwilioInbox

The texts the Twilio emulator sent to phones, read the way a test reads a phone.

twilioPhone

function

twilioPhone(emulator: Pick<Emulator, "store" | "outbox">): TwilioPhone

A phone texting the app's Twilio numbers, as a person would.

uninstallGithubApp

function

uninstallGithubApp( emulator: Pick<Emulator, "store" | "outbox">, installationId: number, ): void

Removes an installation and sends the app its installation deleted webhook.

bachsLedger

function

bachsLedger(emulator: Emulator): BachsLedger

Reads and drives a Bachs emulator from a test.

composioProject

function

composioProject(emulator: Pick<Emulator, "store" | "outbox">): ComposioProject

The project a Composio emulator stands in for: its accounts, tool runs, triggers and expiries.

composioTools

function

composioTools(emulator: Pick<Emulator, "store">): ComposioTools

The tool handlers of a Composio emulator, to answer tools from test code. A reset or restore drops them, so one test's handlers never answer the next test's calls.

nangoProject

function

nangoProject(emulator: Emulator): NangoProject

The Nango environment an emulator stands in for.

nylasApplication

function

nylasApplication(emulator: Emulator): NylasApplication

The Nylas application an emulator stands in for, for tests to read and act on.

unipileWorkspace

function

unipileWorkspace(emulator: Emulator): UnipileWorkspace

The Unipile workspace an emulator stands in for.

novuProject

function

novuProject(emulator: Pick<Emulator, "store">): NovuProject

A Novu emulator's project: subscribers, workflow runs, messages sent and open Inboxes.

pusherBeams

function

pusherBeams(emulator: Pick<Emulator, "store">): PusherBeams

The Beams side of a Pusher emulator: notifications published, and the devices registered.

pusherChannels

function

pusherChannels(emulator: Pick<Emulator, "store">): PusherChannels

The Channels side of a Pusher emulator: published events, live connections, test triggers.

tiptapCollab

function

tiptapCollab(emulator: Pick<Emulator, "store">): TiptapCollabView

A Tiptap emulator's documents as JSON or text, who is editing them, and their faults.

clerkMail

function

clerkMail(emulator: Pick<Emulator, "store">): MailSource

Emails the Clerk emulator sent: sign-in and sign-up verification codes, read like any mail, so mail.code(email) and a recorded typed code work for Clerk's <SignIn/> and Account Portal.

clerkInstance

function

clerkInstance(emulator: Pick<Emulator, "store">): ClerkInstanceView

The Clerk emulator's instance, users, sessions and sent codes, for tests.

stableClerkId

function

stableClerkId(prefix: string, name: string): string

A Clerk-style id derived from name, the same on every run and after every reset, e.g. stableClerkId("user", "ada@example.com"): seeded records keep the ids an app's own database was seeded with.

On this page

Run it on every pull request

A GitHub check and one comment per pull request, with the flight records attached.

Set up CI