AxioDB / Test
AGENTS.md35 starsChanged 9 days agoMITView on GitHub
Global rules live in ../AGENTS.md. This file only adds Test/ specifics — read the root first. Role — the project's whole test surface. No Jest/Mocha — a small hand-rolled runner. Suites are node-based JavaScript run against the compiled lib/ build, so npm run build must pass first. crud · transaction · read · aggregation · auth · http-api · tcp-auth · tcp-noauth · tcp-transaction · tcp-tls · crash-recovery · mcp-confirm · mcp-functional · cache-options new AxioDB() is a singleton —…
- Deletes or force-pushes
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,843 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 repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cli/AGENTS.mdAGENTS.md
- Docker/AGENTS.mdAGENTS.md
- Document/AGENTS.mdAGENTS.md
- electron/AGENTS.mdAGENTS.md
- Email/AGENTS.mdAGENTS.md
- GUI/AGENTS.mdAGENTS.md
- Scripts/AGENTS.mdAGENTS.md
- source/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- skillSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 72
Use fixtures for data, not inline literals, where a fixture fits.
- Very specific: line 73
Always clean up in setUp() and tearDown() — leave no temp dirs.
≈ “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
Test/ — Test Suites (Agent Instructions)
Global rules live in ../AGENTS.md. This file only adds Test/ specifics — read the root first.
Role — the project's whole test surface. No Jest/Mocha — a small hand-rolled runner. Suites are node-based JavaScript run against the compiled lib/ build, so npm run build must pass first.
Layout
AGENTS.md agent instructions (root of Test/ only)
bun/ Bun test suite
run.js orchestrator — spawns each suite in a child process with Bun
helpers/ TestRunner, assertions, fixtures
modules/*.test.js the 14 suites running under Bun
key.js legacy benchmark data
deno/ Deno test suite
node/
run.js orchestrator — spawns each suite in a child process with Node
helpers/TestRunner.js base class: test(), describe(), run(), printResults()
helpers/assertions.js assert.* (isSuccess, isError, throws, equal, includes, …)
helpers/fixtures.js shared sample data
modules/*.test.js the suites
key.js legacy benchmark data (Data_To_Loop_*, schema, …)The 14 suites
crud · transaction · read · aggregation · auth · http-api · tcp-auth · tcp-noauth · tcp-transaction · tcp-tls · crash-recovery · mcp-confirm · mcp-functional · cache-options
Commands
npm run node-test # all suites under Node (ask before running — slow)
npm run node-test crud # one suite under Node — run directly, no permission needed
npm run bun-test # all suites under Bun (ask before running — slow)
npm run bun-test crud # one suite under Bun — run directly, no permission neededWhy child processes
new AxioDB() is a singleton — a second instance in the same process throws. run.js therefore spawns one node (or bun) child per suite with cwd at the repo root. Never require two DB instances in one suite.
Writing a suite
const TestRunner = require('../helpers/TestRunner');
const { assert } = require('../helpers/assertions');
const fixtures = require('../helpers/fixtures');
const fs = require('fs');
const { AxioDB } = require('../../../lib/config/DB.js'); // compiled output, not source/
class MyTests extends TestRunner {
constructor() { super('My Test Suite'); }
async setUp() { /* rm old temp dir, init DB with { GUI: false, CustomPath: <temp> } */ }
async tearDown() { /* rm -rf the temp dir */ }
async runTests() {
await this.describe('Group', async () => {
await this.test('does the thing', async () => {
assert.isSuccess(await this.collection.insert(fixtures.sampleUser()));
});
});
}
}
module.exports = MyTests;Then register the file in the testModules map in run.js (key = suite name used on CLI).
Hard rules
- Require from
../../../lib/...— tests run against the build. Rebuild before trusting results. - Use
fixturesfor data, not inline literals, where a fixture fits. - Always clean up in
setUp()andtearDown()— leave no temp dirs; tests must be re-runnable and parallel-safe. - A
setUp()/runTests()throw already counts as a failure (seeTestRunner.run) — don't swallow it. fixtures.jsandkey.jsare shared; changing them ripples across suites.- ESLint ignores
Test/**— this is plain JS withrequire, not part of the typed core.
Done for this folder
npm run buildfirst, then the affected suite(s) green- New/changed feature has a suite; new suite registered in
run.js - Temp dirs cleaned; no leaked DB instances; CI gates (auth, tcp-*, http-api, mcp-functional, crud/transaction/read/crash-recovery/mcp-confirm) considered
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.

