Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(testing): R9 row; trim R5/R7 wording to stay under the TESTING.md byte cap
garrytan462aff63e4c2
diff --git a/docs/TESTING.md b/docs/TESTING.mdindex 0495edf161..1e9577c092 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -1458,10 +1458,10 @@ cross-subsystem duplicate entries, and byte caps for the entry docs and referenc| **R2** | `mock.module(...)` anywhere in the file | `*.serial.test.ts` || **R3** | `new PGLiteEngine(` outside ~50 lines after a `beforeAll(` line | The canonical block (below) in `beforeAll(` || **R4** | `new PGLiteEngine(` without `engine.disconnect(` in an `afterAll(` block | `afterAll(() => engine.disconnect())` |-| **R5** | `configureGateway(` with no `resetGateway(` (comments ignored): the global gateway leaks to later files | `afterAll(() => resetGateway())`; a child-script-only call takes `isolation-lint: R5-subprocess-only` |+| **R5** | `configureGateway(` with no `resetGateway(`: the gateway leaks to later files | `afterAll(() => resetGateway())`; a child-script-only call takes `isolation-lint: R5-subprocess-only` || **R6** | `currentExitCode(` with no verdict reset outside an after-hook | `beforeEach(() => _resetCliExitVerdictForTests())` |-| **R7** | `__unconfigureGatewayForTests(` or `_clearGatewayForTests(` with no `resetGateway(` in an `afterEach`/`afterAll` hook (comments ignored): an empty gateway leaks into the next file, and an inline restore does not survive a throw or a `-t` filter | `afterEach(() => resetGateway())` (#6514) |-| **R9** | A process-global hook with no undo in an `afterEach`/`afterAll` hook (comments ignored): `installOutputCapture(` or `startCliSocketServer(` without `_uninstallOutputCaptureForTests`, `redirectStdoutLoggingToStderr(` or an inline `_resetStdoutRedirectForTests(` without the reset in a hook, `installSigchldHandler(` without `_uninstallSigchldHandlerForTests`. Each patches console, stderr or a signal listener for every later file in the shard (#7494) | `afterEach(() => _uninstallOutputCaptureForTests())` (or the named undo) |+| **R7** | `__unconfigureGatewayForTests(` or `_clearGatewayForTests(` with no `resetGateway(` in an after-hook: an inline restore does not survive a throw or a `-t` filter | `afterEach(() => resetGateway())` (#6514) |+| **R9** | A process-global hook (see the script) with no undo in an after-hook | Its undo in `afterEach` |Files that violated these rules at the lint baseline are listed in `scripts/check-test-isolation.allowlist`. **The allow-list MUST shrink over time**: never add entries.