From beae15ec80fec0260141583a35498431120ed586 Mon Sep 17 00:00:00 2001 From: alex anikin <60673011+anikinsasha@users.noreply.github.com> Date: Fri, 24 Jul 2026 13:55:16 -0700 Subject: [PATCH] =?UTF-8?q?docs(testing):=20scope=20the=20test-location=20?= =?UTF-8?q?rule=20=E2=80=94=20subsystem=20packages=20keep=20their=20suite?= =?UTF-8?q?=20in-package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md b/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md index 358f76e591..53fa29abc5 100644 --- a/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md +++ b/LifeOS/install/LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md @@ -78,6 +78,8 @@ Mirror the source path, not co-locate. Map: Snapshot files at `test//__snapshots__/.test.ts.snap`. +**Subsystem-package clause.** A directory-tool with its own `package.json` (`LIFEOS/TOOLS//`) keeps its suite in-package at `/test/` with a `package.json` `test` script — the suite travels with the deployable package. The parallel `~/.claude/test/` tree governs the repo-root surface (hooks, skills, single-file tools). + ### 3. Every test file is independently runnable. `bun test test/hooks/Foo.hook.test.ts` works in isolation. No file depends on another file's globals or setup. If shared setup is needed, it goes in `test/preload.ts` and is loaded via bunfig. @@ -311,7 +313,7 @@ Phases 2–5 are tracked separately as PROJECTS.md entries; they're not part of ## Anti-patterns (do not do) -- ❌ Co-locating test files next to source (`hooks/.hook.test.ts` next to `hooks/.hook.ts`). Bun does not do this and the parallel `test/` tree scales better. +- ❌ Co-locating test files next to source (`hooks/.hook.test.ts` next to `hooks/.hook.ts`). Bun does not do this and the parallel `test/` tree scales better. (Repo-root surface only; subsystem packages keep in-package suites per Rule 2.) - ❌ Adding Jest, Vitest, Mocha, AVA, ts-node, ts-jest, sinon, jest-mock to LifeOS's `package.json`. CONSTITUTIONAL FAILURE. - ❌ Setting a global `coverageThreshold = 1.0`. Gamification trap; incentivizes shallow tests. - ❌ Adding a `--retry 3` flag to any test invocation in CI. Banned.