@overengineered-solutions/test-kit
v0.4.0
Published
Shared test helpers for the OES portfolio — Playwright fixtures, tenant isolation, Supabase admin client, RLS emulator, Stripe mocks.
Readme
@overengineered-solutions/test-kit
Shared E2E + integration test helpers for the OES portfolio (oesolutions, primopicks, makeros, plus any new project scaffolded from oes-project-template).
Install
pnpm add -D @overengineered-solutions/test-kitExports
| Path | What it provides |
| --- | --- |
| @overengineered-solutions/test-kit | Top-level barrel — common helpers re-exported from sub-paths |
| ./env | loadTestEnv(dir), requireEnv(name) — env loading from .env.test |
| ./factories | randomEmail, randomSlug, randomPassword, uniqueTag — namespaced test data |
| ./isolation | Tenant-isolation namespacing helpers (every row tagged by runId) |
| ./playwright | makePlaywrightConfig({ appUrl, ... }) — Playwright config factory |
| ./reporters | HandoffLogReporter — posts run summary to OES oes_handoff_log |
| ./rls | withUser(db, sqlTagger, userId, fn) — RLS emulator for postgres integration tests |
| ./supabase | createAdminSupabase(url, serviceRoleKey) — service-role client |
| ./db | createPostgresClient(databaseUrl) — postgres-js client |
| ./mocks/stripe | stripeMock.createMockStripe(spyFactory, overrides?) — framework-agnostic Stripe mock |
Tenant fixture pattern
import { makeTenantTest } from '@overengineered-solutions/test-kit'
const test = makeTenantTest({
create: async ({ adminSupabase, runId }) => {
// …seed per-test data, tagged by runId
},
teardown: async ({ db, runId }) => {
// …delete only this test's rows
},
})
test('something', async ({ tenant, runId, adminSupabase, db }) => {
// ...
})Every row is namespaced by runId (a per-test UUID), so wings are parallel-safe with no global cleanup step.
Provenance
Every published artifact carries a Sigstore-backed provenance attestation linking the npm tarball to the exact GitHub Actions workflow run + commit that built it. Verify with:
npm audit signatures…or visit the package's npmjs page and look for the "Provenance" badge.
Related
@overengineered-solutions/workspace-bridge— sibling shared package for OES IDE workspace integration (CSP + iframe bridge wiring).overengineered-solutions/oes-project-testing— the E2E test wings that consume this package.
License
MIT
