Skip to content
Docs
Changelog

Test-only code leaves production modules

Seven Promise facades, two counters and four fixture files that only tests used are gone from production modules, and a test keeps new ones out.

Markdown

  • No facade for tests. The cron jobs and the RevenueCat verification each carried a Promise wrapper that no production code called (runPendingAudits, runPendingAuthCleanup, runPendingUploads, runWebhookJobs, runPendingPush, runPendingBilling, verifyRevenueCat). They are deleted, with the standalone webhook round that only served one of them. Tests run the job's Effect with runJob from packages/api/src/testing/run-job.ts. See Testing.
  • Fixtures and counters moved out. The provider sample payloads are now packages/api/src/testing/billing-fixture-{stripe,polar,pagarme,revenuecat}.ts. The request scope no longer exports a create counter: its tests count calls of the factory they bind.
  • A test holds the line. scripts/test-only-exports.test.mjs fails an export that only tests reference. The 46 that remain are listed with a reason, and the list may only shrink. scripts/effect-run-sites.test.mjs pins the three modules that may call Effect.run*, which turns "one run* per entry point" from a review rule into a test. See Enforcement.
  • ADR text corrected. ADR-0010 named two Effect.runPromiseExit sites; sendEmail in packages/email is the third, and ADR-0005 now says a facade exists only where production code outside Effect calls it.
Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.