testing
Installation
SKILL.md
Testing conventions and in-memory databases
When to use: Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.
Package exports (test code isolation)
Test utilities (fakes, in-memory DB helpers, fixtures) must not be exported from a package’s main entry (src/index.ts).
- Never re-export from
./test/or./testing/in the mainsrc/index.ts - To expose test helpers, add a
/testingsubpath inpackage.jsonexports:
{
"exports": {
".": "./src/index.ts",
"./testing": "./src/testing/my-test-helpers.ts"
}
}