Skip to content

Skip Resend E2E tests under Bun without credentials #34

Description

@dahlia

The Resend E2E suite runs under Bun even when its required environment variables are missing.

The suite currently uses the skip option on describe():

describe("ResendTransport E2E Test 1", {
  skip: !hasApiKey() || !setupTransport() || !hasVerifiedDomain(),
}, () => {
  // ...
});

Bun 1.2.22 does not honor this suite-level skip option as expected for node:test. The suite callback still registers its child tests, and those tests run even though hasApiKey() returned false. Because setupTransport() was short-circuited, testConfig and transport remain uninitialized.

This causes fork pull requests, which cannot access the repository's Resend secrets, to fail with errors such as:

TypeError: undefined is not an object
(evaluating 'testConfig.recipientEmail')

The failure can be seen in the test-bun job from PR #32.

This is unrelated to the Mailtrap changes in that pull request. It is an existing portability problem in the Resend E2E test setup.

The suite should select either describe or describe.skip before defining the tests, following the pattern already used by the Lettermint, Maileroo, Mailtrap, Plunk, and SendGrid E2E suites. The Resend suite needs two variants: one for tests requiring only the API key, and another for tests that also require a verified domain.

Acceptance criteria:

  • All Resend E2E tests are skipped under Bun when RESEND_API_KEY is absent.
  • Tests requiring a verified domain are skipped when RESEND_VERIFIED_DOMAIN is absent.
  • The E2E tests still run when their required configuration is present.
  • Node.js and Deno behavior remains unchanged.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions