teamem / tests
AGENTS.md1 starsChanged 6 months agoApache-2.0View on GitHub
Bun test suite organized by scope: unit/ for pure logic, integration/ for tool + DB behavior, scenario/ for multi-agent simulations, plus e2e, perf, plugin, migration, security, smoke, load, chaos, helpers, and fixtures. Run all suites with bun test or bun run test. Test files import from bun:test. None at this level — all tests live in the subdirectories below.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- plugin/AGENTS.mdAGENTS.md
- plugin-e2e-module/AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- rddSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Run all suites with bun test or bun run test.
- Distinctive: line 45
Prefer in-memory SQLite over mocking for store-level tests.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Parent: ../AGENTS.md --><!-- Generated: 2026-05-01 | Updated: 2026-05-13 -->tests
Purpose
Bun test suite organized by scope: unit/ for pure logic, integration/ for tool + DB behavior, scenario/ for multi-agent simulations, plus e2e, perf, plugin, migration, security, smoke, load, chaos, helpers, and fixtures.
Run all suites with bun test or bun run test. Test files import from bun:test.
Key Files
None at this level — all tests live in the subdirectories below.
Subdirectories
| Directory | Purpose |
unit/ | Deterministic unit tests for pure logic — see unit/AGENTS.md |
integration/ | Tool + DB + server integration tests — see integration/AGENTS.md |
e2e/ | Cross-process/runtime roundtrips — see e2e/AGENTS.md |
scenario/ | Multi-agent workflow simulations — see scenario/AGENTS.md |
perf/ | Latency benchmarks and long-poll saturation checks — see perf/AGENTS.md |
plugin/ | Claude plugin bundle/script behavior tests — see plugin/AGENTS.md |
migration/ | SQLite migration compatibility tests — see migration/AGENTS.md |
security/ | Auth, JWT, and access-control tests — see security/AGENTS.md |
smoke/ | Manual and automated smoke coverage — see smoke/AGENTS.md |
load/ | Load-oriented tests — see load/AGENTS.md |
chaos/ | Failure-injection tests — see chaos/AGENTS.md |
helpers/ | Shared test helpers — see helpers/AGENTS.md |
fixtures/ | JSON event fixtures (valid + invalid) — see fixtures/AGENTS.md |
For AI Agents
Working In This Directory
- Tests import
describe/it/expectexplicitly frombun:test; follow that style. - Database-backed tests follow the same setup pattern:
createSqliteClient(':memory:')→runMigration(db, '<repo>/src/infra/db/migrations/001_init.sql')→new SqliteEventStore(db)→createTeamemTools({ db, store }). - Migration paths are resolved with
join(process.cwd(), 'src/infra/db/migrations/001_init.sql')— tests assume the repo root is the working dir.
Testing Requirements
- Mirror the source tree: a file at
src/foo/bar.tstypically has a test attests/unit/foo/bar.test.ts. - Prefer in-memory SQLite over mocking for store-level tests.
- Scenario tests double as smoke perf checks (
scenario/team-workflow.test.tsasserts < 100 ms).
Common Patterns
- Helper
setup()per test file builds a fresh{ db, store, tools }triple. - Event factories like
sampleEvent(overrides)andevent(overrides)keep envelope boilerplate out of test bodies. - Fixtures are loaded with
JSON.parse(readFileSync(...))fromtests/fixtures/.
Dependencies
Internal
src/— every layer is exercised somewhere here.
External
bun:testnode:fs,node:path
<!-- MANUAL: -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

